Описание тега umask
Umask is a Unix command to specify default permissions for the new files, created by the current user. umask is inverted (umask 0 = world readable, writeable and executable).
It is used when multiple users produce some shared data but any user must be capable of overwriting this data.
The default umask is often selected so to 022 (only owner can modify the file but the group and the world can read) or to 002 (owner and group can modify the file, the world can read).
umask accepts the same bitwise mask as chmod command, but it is inverted: it specifies bits that must not be set. For instance
umask 555
touch t.tmp
ls -l t.tmp
will result
--w--w--w- 1 me 0 2013-01-25 09:11 z.tmp
(444 is the "write only" flag). By concept, the mask serves for removal of permissions (000 - nothing is removed, 777 - all removed).
Regardless of umask, the newly created files may not be executable, for instance on Ubuntu 10.04:
umask 0
touch x.tmp
ls -l x.tmp
will anyway result
-rw-rw-rw- me 0 2013-01-25 09:36 x.txt
even if the lowest (execute) bit is 0 in umask.