Unix commands
File permissions on html server (recursive chmod) differentiating between files and directories
I recursively screwed up the file permissions in my html servers root directory. To fix it I needed to deploy some "advanced" chmod settings. Obviously I want to treat directories and files differently. I didn't come up with a better solution than the following:
chmod -R u=rw-x,g=rw-x,o=r-wx *
chmod -R a+X *
tar copying via ssh
tar czv sourcepath | ssh -l username 192.168.0.5 tar xz -C targetpath
Finding files with find
find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' This finds and lists the largest files on /
find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | sort This finds the most recently changed files under the current directory