On most of the Linux distributions, the default system-wide value is set in pam_umask.so or in /etc/profile file. By adding the value in ~/. bashrc file in the user’s home directory, we can make a umask value specific for the user. To check umask value, execute umask command.
How do I use umask in Linux?
The Umask Command Syntax
umask [-p] [-S] [mode] The user file-creation mask is set to mode. If mode begins with a digit, it is interpreted as an octal number; otherwise it is interpreted as a symbolic mode mask similar to that accepted by chmod(1). If mode is omitted, the current value of the mask is printed.
Why do we use umask in Linux?
Umask is a C-shell built-in command which allows you to determine or specify the default access (protection) mode for new files you create. (See the help page for chmod for more information on access modes and how to change modes for existing files.)