1

In /var/www, I want all folders (recursively) to have the permissions of 755. I want all files to have the permission of 644. I want all new files and folders to take on these permissions as well.

I've been looking at many examples but I feel like I'm never going to figure this out. Any help would be appreciated.

0

2 Answers 2

0
chmod -R a-rwX /dir
chmod -R u=rwX,g=rX,o=rX /dir
1
  • This answer should include some more information about what is going on.
    – kasperd
    Jun 26, 2015 at 8:47
0

For Files :

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

For Folders :

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

These will change all the file permissions to 644 and set the permissions to 755 for folders.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .