Recursively Change Directory and File Permissions

If you’ve messed up the permissions in a directory, you can recursively fix it with find.

# Operate on directories:
find <path> -type d -exec chmod 755 {} \;

# Operate on files:
find <path> -type f -exec chmod 644 {} \;