Recursively restore default file and directory permissions on Linux

Another one of my screw-ups in the past was messing with permissions, especially permissions with Apache2 and that constant battle I had before finding mpm_itk.

Run these commands within the folder you're having issues with. Or replace the periods with the directory you wish to target.

This command recursively finds files and restores the permissions to 664

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

 This command recursively finds directories and restores the permissions to 755

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

 

Print