Recursively chmod directories only

Warning: This post is for geeks only! Movabletripe‘s post explaining how to recursively chmod only directories has been a helpful reference to me in recent months. However, today I tried to access the site, and it was down. So, I pulled the post’s contents from Google’s cache so that I’ll have my own copy for safe keeping:

find . -type d -exec chmod 755 {} \;

This will recursively search your directory tree (starting at dir ‘dot’) and chmod 755 all directories only.

Similarly, the following will chmod all files only (and ignore the directories):

find . -type f -exec chmod 644 {} \;

This entry was posted in Asides and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>