Directory Permissions

chmod the current directory, and all subdirectories and files. The below will make the current directory, and all subdirectories and files readable, writable, and executable for the owner and group, ensuring they’re only readable and executable for everyone else.

chmod -R 775 ./

Recursively chmod Directories or Files

# This will recursively search your directory tree 
# (starting at your current directory) and chmod 755 only the directories below
find ./ -type d -exec chmod 755 {} \;

# Similarly, the following will chmod all files only 
# (and ignore the directories):
find ./ -type f -exec chmod 644 {} \;

# Change files of only a specific type/extension 
# (pdf in this case):
find ./ -name *.pdf -exec chmod 755 {} \;
Snippets and tagged