LinuxAnswers - the LQ Linux tutorial section.
Go Back > Blogs > neonsignal
User Name


Rate this Entry

recursively setting permissions

Posted 05-30-2011 at 07:26 AM by neonsignal

The chmod itself can be used recursively to set the permissions on a directory and the subtree of that directory:
chmod -R u=rwX,go=rX directory
the 'X' flag only sets execute permissions if the node is a directory or already has execute access.

Alternatively, find can be used to give a little more control over the changes. For example, sometimes it is useful to clear all the execute bits after data files have been transferred from a FAT32 system.
find directory -type d -exec chmod 755 {} \;
find directory -type f -exec chmod 644 {} \;
Posted in Uncategorized
Views 224 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 02:17 PM.

Main Menu

Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration