2
Having set everything in my project to 777
(rwxrwxrwx
) for debugging purposes, I wanted to dial down the openness and set the directories (not the files) in the root folder to 664
(rw-rw-r--
).
To do this I used (from How to list folders using bash commands?):
chmod 664 -- */
This worked as expected. Then I realized I needed the execution bit on directories to enter them. So I tried:
chmod 764 -- */
But that threw a missing operand after "764"
error.
I can change the permissions by hand (chmod 764 <dir-name>
) and there aren't that many directories so it's not a big problem, but I'd like to understand.
Why can't I use chmod 764 */
to set the directories in my current path to rwxrw-r--
?
Not an answer to your question, but you may like to know that
chmod +X
(possibly together with--recursive
) would be appropriate for this situation; it grants execute/search permission only if a file is a directory or already had execute permission (frominfo '(coreutils.info.gz)Conditional Executability'
). – Edward – 2015-01-27T07:46:44.143