After I apply chmod -R to a directory, permissions are changed for everything within (files and directories). How can I add execute/search (x) permissions to directories without modifying the files?
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
|
|
You can use find.
Where 750 is the mode you'd like to apply and "./" is the directory you will recursively search. EDIT: Thanks to @Gilles and find(1), I've revised this for additional security and performance. |
||||
|
|
In this particular case you can use In general (e.g. if you wanted to make all directories readable without affecting the files), you could either use |
||||