There are various introductions of umask command and mask value on the net, I will post an article because I found it difficult to use logical sum, logical product, and bit inversion.
When creating a new file or directory Decide what kind of access rights (permissions) to mask.
You can ** mask ** for each ** user **. By the way, umask is an abbreviation for user mask.
In the first place, what is a mask means "cover". The mask we wear also "covers" the mouth, doesn't it?
Let's look at the relationship between the umask command and the mask value. Originally, when creating a new file or directory, all privileges (777) are granted. By subtracting the mask value there, the access right actually granted is determined.
. 755 ← umask -S execution result ... *
** When creating a file, the x right is deprived from the access right of * It will be 644 (rw-r--r--). ** **
The thousands digit "0" that is output when the umaks command is executed represents a special access right.
If you want to change the access right when creating a new file or directory, use the umask command. X rights are deprived when creating a file, so if you want to execute it as a program file Grant X rights with the chmod command. ~~ I hope the distribution of masks will return to normal soon ... ~~