Feed on Posts or Comments 10 March 2010

Debian Wytze on 25 Jul 2008 10:44 am

Debian modifying permissions for files or directories

Sometimes you want to change specific settings to either files or directories on your debian machine. To be able to do this I use the find command combined with the xargs command. Have a look at some possible commands:

find /share/ -type f -print0 | xargs -0 chmod 664
find /share/ -type d -print0 | xargs -0 chmod 775

The first line tries to find files only with -type f. And prints them to the stream with -print0 so xargs can process them with the -0 command. -print0 will put a NUL value between pathnames. This way paths that contain spaces can be parsed correctly by xargs.
I think it is pretty nifty and once again shows the power of the console!

Trackback This Post | Subscribe to the comments through RSS Feed

Leave a Reply