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

Notices

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:
Code:
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.
Code:
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

Comments

 

  



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

Main Menu
Advertisement

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