Recursively chmod directories only

The -type d switch is the key:

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


This will recursively search your directory tree (starting at the current directory) and chmod 755 all directories only.

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

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

source: http://movabletripe.com/archive/recursively-chmod-directories-only/ At this source, there is discussion and additional find commands from responders.

If you find this post helpful, please click an ad below. Thanks!


This entry was posted in Linux, WebTechnology. 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>