How can I do a recursive chmod only on directories?

Run find on -type d (directories) with the -exec primary to perform the chmod only on folders:

find /your/path/here -type d -exec chmod o+x {} \;

To be sure it only performs it on desired objects, you can run just find /your/path/here -type d first; it will simply print out the directories it finds.


See Command line examples - chmod in the Wikipedia.

# Remove the execute permission on all files in a directory 
# tree, while allowing for directory browsing.
chmod -R a-x+X directory    
                            

As added by Daniel: this should work in your case:

chmod -R o+X directory

Tags:

Linux

Chmod