Recursively chmod only directories find . -type d -exec chmod 755 {} \; Similarly, recursively set the execute bit on every directory chmod -R a+X * The +X flag sets the execute bit on directories only See note from commenter, below, about effect on files ↓ Recursively chmod only files find . -type f -exec chmod 644 {} \; Recursively chmod only PHP files (with extension .php) find . -type f -name ‘*.php’ -exec chmod 644 {} \;
![Recursive chmod Tricks chmod-linux-1](https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2011/07/chmod-linux-1-150x150.png?x25141)