I recently encountered a permissions problem when installing a new application on my Wiredtree VPS.  The crux of the problem was some of the necessary files have the wrong access permission thereby rendering the application almost inoperable.  To fix that, I needed to change permissions of a whole lot of files and folders.  And while I could’ve changed the permissions individually, it would’ve taken quite a long time so here’s what I found to work

To set all the folders to 755:

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

To set all files to 644:

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

Let’s say you want to change the permissions of files that end only in .rb and set it to 755 (pattern escaped with slashes)

find . -name \*\.rb -exec chmod 644 {} \;

Simple right?