Reputation:
I am trying to recursively change permissions for all directories and files within my current working directory but while excluding one of the directories.
I have tried a bunch of variations of the following command and can't get it quite right
find . -type d ! -name directoryName -exec chmod -R 700 {} +
Upvotes: 0
Views: 38
Reputation:
This did it. Thank you guys for the suggestions.
find . ! -name website ! -path "./website/*" -exec chmod 700 {} +
Upvotes: 0
Reputation: 798746
The -R
argument to chmod
tells it to work recursively. Since you're enumerating all the objects individually you should not use this option.
Upvotes: 1