The Linux user file-creation mode mask (umask) is used to determine the file permission for newly created files. umask can be used to control the default file permission for new files. umask is a four-digit octal number.
The permission for the creation of new executable files is calculated by subtracting the umask value from the default permission value for the file type being created. An example for a text file is shown below with a umask value of 022:
666 Default Permission for text file
-022 Minus the umask value
644 Allowed Permissions