DormanResearch : UMask?

Referers: FilePermissions :: (Remote :: Orphans :: Tree )

Dorman Wiki
Dorman Lab Wiki
The umask defines the permissions a new file will get - or better: the permissions it will not get.

You can display the current umask numeric and as text:

user@host:~ $ umask
0027
user@host:~ $ umask -S
u=rwx,g=rx,o=

The numbers mean the following:

0 0 2 7
| | | '-> permissions for others (o)
| | '-> permissions for the group (g)
| '-> permissions for the owner (user, u)
'-> special permissions (SUID, SGID, sticky) - always 0 in umask

The digits for user, group and others are the sum of:

* 1 - execute permission (x)
* 2 - write permission (w)
* 4 - read permission (r)

Therefore umask 0027 means:

* all permissions for the file owner (user)
* no write permissions (but read and execute permissions) for the group
* no permissions for others

You can specify the umask with the command umask 0027. The number can vary, of course. The umask you define this way is valid in the current shell and all child processes. If you set the umask in ~/.profile, it is valid for the whole time you are logged in. If you define it in a xterm, it is only valid for everything you do in this xterm.

See DirectoryUMask to see how to change umask for a particular directory.
There is no comment on this page. [Display comments/form]