Some usefull unix commands

These commands works on any unix machines

Recursively copy an entire file hierarchy

Local copy

 cd fromdir; tar cBf - . | (cd todir ; tar xBf -) 


Between machines

 cd fromdir; tar cBf - . | rsh remote "(cd todir ; tar xBf -)"

Recursively change file/directory unix rights

Change all directories to drwxr-xr-x

 find . -type d -exec chmod 755 {} \; 


Change all files to -rw-r--r--

 find . -type f -exec chmod 644 {} \;

 

Recursively grep a pattern and show matching file names

 find . -name '*' -exec grep toto /dev/null {} \;

Web Content Display