These two nifty commands allow you to set separate permissions on files or directories within a document root on POSIX based file systems such as linux or Mac OS X with a single comment. They’re an invaluable tool in any web developers arsenal!
To reset the permissions on all files within a document root you can run from the command:
find . -type f -exec chmod 644 {} \;
Or for all directories (files) within the document root:
find . -type d -exec chmod 755 {} \;