You're viewing a comment by Nick Coleman and its responses.

Nick Coleman Permalink
March 01, 2011, 01:26

Re-reading the chmod man page shows that a+... (or its variants a- & a= ) sets the flags to the settings, whereas the shortcut '+' sets the flags except for bits set in the umask.

I confirmed this by playing around. You can see your current umask with 'umask -p'.

My umask is 022 (like most, I think). Try 'chmod a+rwx file', then reset with 'chmod u=rw,go= file' then 'chmod +rwx file'. In the second case, the 'w' bit is not set for group and other users, despite being indicated in the command.

The practical effect of this is that 'chmod + etc' sets the flags but retains the default rwx settings, whereas 'chmod a+ etc' sets the flags irrespective.

Thanks Peter, for causing a useful discussion for what initially seemed like a very simple topic.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the first letter of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.