<a name=


User's file creation mask. Set the shell process's file creation mask to mode.

      umask [-p] [-S] [mode]

      mode  File creation mask
      -S    Print the mask in symbolic format
      -p    Output in a form that may be reused as input

The current value of the mask will be printed if mode is omitted,

If mode begins with a digit, it is interpreted as an octal number; if not, it is interpreted as a symbolic mode mask similar to that accepted by the chmod command.

The return status is zero if the mode is successfully changed or if no mode argument is supplied, and non-zero otherwise.

Note that when the mode is interpreted as an octal number, each number of the umask is subtracted from 7. Thus, a umask of 022 results in permissions of 755.

This is a BOURNE shell command.

"A specialist is someone who does everything else worse" - Ruggiero Ricci

Related commands:

export - Set an environment variable
chmod - Change access permissions
chown - Change file owner and group
readonly - Mark variables/functions as readonly