Modify permissions on just directories or files using find.

I came across a situation where I wanted to change all directory permissions to 755 and did not want to modify the file’s permissions. Use the Linux find utility to identify directories.

find /home/somedir -type d | xargs chmod -v 755

The same can be applied to just files, instead of directories.

find /home/somedir -type f | xargs chmod -v 644
This entry was posted in Programming, Webhosting and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.