Linux: Setting File Permissions On Folders and Directories

To set all the files and folders in a directory to 755 use chmod:
chmod -R 755 /foo/bar

To set the directories to 755 and set the file to 644 for this you can use the find command e.g.
to change all the directories to 755:
find /foo/bar -type d -exec chmod 755 {} \;
to change all the files to 644:
find /foo/bar -type f -exec chmod 644 {} \;

Leave a ReplyCancel reply

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

Exit mobile version
%%footer%%