-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2253
Joachim Ansorg edited this page Nov 12, 2021
·
2 revisions
chmod -r 0700 dir
chmod -r file
chmod -R 0700 dir
chmod a-r file
Many tools use -r
for recursive operation, but in chmod
this removes read permissions.
If you wanted to change permissions recursively, change the flag to -R
. If you wanted to remove read permissions, consider using a-r
explicitly to make this more obvious.
If you're using it correctly and don't mind the potential for confusion, you can save a single character by ignoring this warning.
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!