February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Displays or sets the file mode creation mask.
Syntax
umask [-S] [mask]
Options
-S produces symbolic output.
Oddities
The one's complement of the umask value is bitwise or'ed with octal 666 (for regular files) or octal 777 (for directories) to determine the permission to set on a new file or directory.
Octal? Isn't this the twenty-first century? It shows the PDP 11 origins of UNIX.
Example
$ umask 0002 $ $ umask -S u=rwx,g=rwx,o=rx $
Read now
Unlock full access