Thursday, July 30, 2009

Recursive touch - I blog, therefore I am

Recursive touch - I blog, therefore I am: "Recursive touch
Published on Sat 30 Jun 2007 06:06 ( 2 years, 1 month ago)
Shell script Linux/Unix

'touch' is a unix command used to change the time of a file or directory, touch a directory will not touch the files inside.

To touch recursively, it's simple with the help of 'find' and 'xargs':

e.g.



find . | xargs touch


will touch all files and directories recursively under current directory.

Since directory or filename may contain spaces, the shell script need some additional parameteres:



find '$1' -type f -print0 | xargs -0 touch"

Tips For Linux - Understanding file permissions and modifying them using chmod - Page 2

Tips For Linux - Understanding file permissions and modifying them using chmod - Page 2: "Frequently used numeric parameters for chmod
755
The general preferred permissions for almost all the files on your disk
700
Extremely private data
500
Extremely private data that you would not like to accidentally modify. So write protect it
775
General files used when working as a Group (Others can only view/execute your files)
770
Important files used when working as a Group (Others cannot do anything with your files)
750
Allowing group to view your files but no write access (Others cannot do anything with your files)
777
Something you should never want to do ;-)"