7

I'd like to know how could I change the permissions of all my folders recursively under a path (e.g. /Users/me/Desktop/main_folder) and also change permissions to all my files under a specific folder.

These are the permissions I'd like to assign:

  • All folders: 700
  • All files: 600

There's a question for folders, but I didn't find one for the files.

1

1 Answer 1

9

That's

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

for all directories begining from . the current directory, and

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

for the files.

Is there a way to know all the folders modified?

That would be

find . -type d -exec chmod 700 {} \; -exec echo {} \;

I have to cd to the root folder first right?

PLEASE DO NOT DO THIS FROM THE ROOT DIRECTORY: you will make all executables un-excutable, including ls, rm, mkdir, and so on. The system will become unmanageable!!!

3
  • I have to cd to the root folder first right? Dec 19, 2015 at 23:08
  • Is there a way to know all the folders modified? Dec 19, 2015 at 23:09
  • Nou haha, when I said root folder, I meant the root of my app for example. Dec 19, 2015 at 23:43

You must log in to answer this question.

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