-2

I want to make an chmod command that's recursively will apply the privilegies to all directoris under that. Example:

chmod 666 /usr

I want that every directory under "/usr" turn into permissions to 666.

Thanks in advance.

mdpc
  • 11,856
  • 28
  • 53
  • 67
guisantogui
  • 121
  • 1
  • 3
  • 4
    You surely don't want to make that change to `/usr`. There are good reasons that linux distributions set the permissions they do, and it is at your own peril to change them in such a drastic fashion. – EEAA Feb 06 '13 at 02:16
  • To expound, the security ramifications of making this change are profound. Giving write access to all of `/usr`, well, you might as well walk around all day with your pants down. – EEAA Feb 06 '13 at 02:21
  • Frankly, *If you can't figure out how to do this without asking us you've got no business doing it*. Please see the question I've marked this as a duplicate of for why this is a ***BAD IDEA***. If after reading and understanding that question and the answers you still think this is what you want, ask the question again in terms of a practical end goal rather than its current form, which is effectively "How to I wreck my system to the point where I have to reinstall it?" – voretaq7 Feb 06 '13 at 03:22
  • Did `chmod -R 666 /usr` not provide the desired results? – jscott Feb 06 '13 at 03:40
  • No I won't chmod at /usr, it was just an example. – guisantogui Feb 07 '13 at 02:05

1 Answers1

1

First, please learn to read man pages:

$ man chmod

Partway down that page, you will see:

-R, --recursive
              change files and directories recursively

And there's your answer.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • This was not an answer (the `man` for chmod is pages and pages long -- that's the point why OP is here). Here is the real answer: `chmod 666 -R /usr` – dylanh724 Jun 09 '20 at 03:49