Get or set the file mode creation mask (POSIX)
umask [-o|-s|mask]
Neutrino
If you specify the mask in octal form, it replaces the current file mode creation mask. Every bit that's set describes a mode bit that won't be allowed in the file mode of created files. In other words, it says: "mask this bit off."
The symbolic form of the mask is an expression that modifies or replaces the current file mode creation mask. The form of the symbolic mask is similar to that of the mode operand for the chmod utility:
[[augo] [+|-|=] [rwx]] [,symbolic_mask]
Where:
The umask utility sets the file mode creation mask of the invoking process to the value specified by the mask operand. The file mode creation mask affects the initial value of the file permission bits of subsequently created files when no mode is specified.
When files are created without specifying the permission mode bits, the filesystem assigns default permissions of 0777 (rwxrwxrwx) to directories and executable files, thereby giving read, write, and execute privileges for user, group, and others. For files that aren't executable, permissions of 0666 (rw-rw-rw-) are assigned. The umask utility is used to adjust these defaults.
The file mode creation mask is inherited by any children of the current process.
You can use either of the display forms (-o or -s) as the mask operand to a subsequent invocation of umask.
As in the chmod utility, the use of the octal number form of mask values is deprecated.
The shell has a builtin umask command; see ksh. To make sure you use the executable, specify the full path.
$ umask a=rwx
Display the current file creation mode mask in symbolic form:
$ umask -s u=rwx, g=rwx, o=rwx
Display the current file creation mode mask in octal:
$ umask -o 00
$ umask u=rw
Display the current file creation mode mask in symbolic form:
$ umask u=rw,g=,o=
Display the current file creation mode mask in octal:
$ umask -o 0177
$ umask go+r
Display the current file creation mode mask in symbolic form:
$ umask u=rw,g=r,o=r
Display the current file creation mode mask in octal:
$ umask -o 0133