6

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.

7

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!!!

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.