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