Here is a technique I use to recursively change all of the file or folder permissions within a directory using the terminal. It will find all of the files or folders and change their permissions accordingly using the chmod command.

For Directories:

1
find /the/path/to/your/targeted/directory/ -type d -exec chmod 755 {} \;

For Files:

1
find /the/path/to/your/targeted/directory/ -type f -exec chmod 644 {} \;