Sample Shell programs


hide - as hidden as possible

chmod  u+rwx,go-rwx  $*

norm - as open as possible

chmod  u+rwx,go+rx-w  $*


semihide - just open enough as needed for Web

directories:

chmod  u+rwx,g-rwx,o+x-rw  $*
files (web pages, images, etc):
chmod  u+rwx,g-rwx,o+r-xw  $*
CGI scripts:
chmod  u+rwx,g-rwx,o+rx-w  $*
"norm" could of course replace all 3 if you don't mind granting more access than strictly necessary.


myspace - which of my directories use the most space

cd $HOME
du | sort -n


wipe - clean up editor backup files

rmifexists  *%
rmifexists .*% 

rmifexists  *~
rmifexists .*~

rmifexists  *.bak
rmifexists .*.bak

rmifexists  *.BAK
rmifexists .*.BAK
Certainly easier than having to point-and-click each one.

Exercise - Write a recursive wipe.