LinuxCommandLibrary

umask

TLDR

Show current mask

$ umask
copy
Show symbolic
$ umask -S
copy
Set mask
$ umask [022]
copy
Restrictive mask
$ umask [077]
copy
Permissive mask
$ umask [000]
copy

SYNOPSIS

umask [-S] [mode]

DESCRIPTION

umask sets file creation mask. It affects permissions.
Default permissions. New files and directories.
Octal notation. Bits to remove.
Shell builtin. Session scope.
Security setting. Restrict access.

PARAMETERS

-S

Symbolic output.
mode
Octal mask value.

COMMON VALUES

- 022 - Standard (files 644, dirs 755)
- 077 - Private (files 600, dirs 700)
- 002 - Group writable

CAVEATS

Shell builtin. Not persistent across sessions. Inverted logic.

HISTORY

umask is a standard Unix command for setting the file mode creation mask, present since early Unix.

SEE ALSO

chmod(1), chown(1), stat(1)

Copied to clipboard