man.lsPlain-English help for Unix commands

umask Set default permissions for new files

Controls which permissions are taken away from new files and folders when they are created. The mask is a number: the permissions it contains are removed from the starting point. It is a shell built-in, so it affects only the current shell and the programs it starts.

Synopsis

umask [-S] [mask]

Common options

Option or formWhat it does
-SShow the current mask in symbolic form, as the permissions that are allowed (for example u=rwx,g=rx,o=rx)
-pPrint the mask as a command you can reuse. Works in bash
022The usual default. New files get 644 (rw-r--r--) and new folders get 755 (rwxr-xr-x)
027Group can read, others get nothing. New files get 640 and new folders get 750
077Only the owner gets access. New files get 600 and new folders get 700
002Shared group work. New files get 664 and new folders get 775

Examples

Show the current mask
umask
Show the mask as permissions that are allowed
umask -S
Create a private file in a subshell
(umask 077; touch private.txt; ls -l private.txt)
Compare with a normal new file
(umask 022; touch normal.txt; ls -l normal.txt)
Make a private folder
(umask 077; mkdir secret; ls -ld secret)
Make a permanent change for every new terminal
echo 'umask 027' >> ~/.zshrc

Notes

See also

Last reviewed 2026-10-07.