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:
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:
chmod -R u=rwX,go=rX directory
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 {} \;
Total Comments 0




