Dec 5, 2008

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 {} \;

0 Responses

Leave a Reply: