Change permissions on all files and/or all directories

I recently needed to change the permissions of all files inside a directory (only files but not folders), including subdirectories. From the command line in Mac OS X, I ran this command with success which changed all files recursively to 666 (rw-rw-rw-):

sudo find . -type f -exec chmod 666 {} \;

Likewise, to change only directories to 777 (rwxrwxrwx), I used:

sudo find . -type d -exec chmod 775 {} \;

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.