Setting rights for public_html
~/public_html you have a bunch of stuff and you want them to be accessible for the outside world. You don’t want to set the rights by hand for each file. What to do?
You need the following script:
#!/bin/bash # setjog-here.sh find . -type d -print0 | xargs -0 chmod 755 find . -type f -print0 | xargs -0 chmod 644 chmod 755 . chmod u+x $0
It works recursively from the directory where you launched it. For folders it sets the right 755, for files 644.
When I started the university and we got an account to a UNIX machine, a friend of us (Mocsa) wrote a similar script for us. At that time we didn’t know anything about bash programming :)