I want to set my folders permissions to 555 and my files permissions to 554, so I tried the following chmod
:
sudo chmod -R -v ug=rx,o=r,a+X mydir/
I thought this would set the user
and group
permissions to r-x
and others
permission to r--
, but since there is an a+X
only folders would receive an r-x
for the others
permission, but files would remain r--
.
But this isn't working and it is setting all the files and folders to 555, even if I set all folders and files to 444 before to assure there isn't any x
permission anywhere.
Why this chmod
command doesn't work as I expected it to?
man chmod
, it's all in there... – heemayl May 10 '17 at 03:19execute/search only if the file is a directory or already has execute permission for some user (X)
, which I thought it meant only for the same user as this was the only thing that made sense in my head – mFeinstein May 10 '17 at 03:31