Simple bash script to clean a folder
Simple example of how to automate a folder cleaner using shell scripting:
At the top we have a line that lets the program know that we want it to run on bash. There are more shells than bash, for example dash
or sh
, etc.
As you can see #
is what we use to mark a comment. Then we simply outline all the commands that the program would have to do. After this we can save and exit back to the terminal.
To make the program executable we need to change its chmod
in this case we chage it to 755
whiche means that the owner can read, write, execute and the users and group can read and execute.
My site is free of ads and trackers. Was this post helpful to you? Why not
Disqus is great for comments/feedback but I had no idea it came with these gaudy ads.