Firstly you should know that:
+
means add this permission to the other permissions that the file already has.=
means ignore all permissions, set them exactly as I provide.Using +x
you are telling to add (+
) the executable bit (x
) to the owner, group and others.
ugo+x
or u+x,g+x,o+x
x
it will considers all of them. And as @Rinzwind pointed out, it's based on umask
value, it adds the bit to the ones umask
allows. remember if you specify the target like o+r
then umask
doesn't have any effect anymore.u+x
to only add executable bit to the owner.Using 755
you are specifying:
u=rwx
(4+2+1 for owner)g=rx
(4+1 for group)o=rx
(4+1 for others)So chmod 755
is like: chmod u=rwx,g=rx,o=rx
or chmod u=rwx,go=rx
.