When we log on to the system and create a file that always has a default permission, then how does this permission come from? That's what Umask did. Umask set the user to create the default permissions of the file, it and chmod effect just the opposite, Umask set is the permission "complement", and chmod set is the file permission code. $[HOME]/.BASHRC values can generally be set in/etc/profile,/ETC/BASHRC, $ [Home]/.bash_profile, $[home]/.profile, or umask. Depending on the Linux distribution, such as Fedora19 to change its own umask value, the Umask value added under $[home]/.profile or $[home]/.bash_profile cannot overwrite the value of the/etc/profile configuration. , you must increase the Umask value under $[HOME]/.BASHRC to permanently define your own umask value.
It is well known that X means only if the file is a subdirectory or the file has been set up to perform
If the executable is not set, for the file, there are RW these two items, that is, the largest for 666–rw-rw-rw-
For a folder, the preset is open for all permissions, i.e. 777 drwxrwxrwx
View umask values as direct input umask
-S: Displays the current mask.
user@pcxxxx:~/debug/test$ umask-s
U=rwx,g=rwx,o=rx
You can see the difference between the umask of different users:
root@pcxxxx:~# Umask
0022
root@pcxxxx:/home/user/debug/test1# LL
Total Dosage 12
Drwxr-xr-x 2 root 4096 April 14 16:01./
Drwxrwxr-x User User 4096 April 14 16:00. /
-rw-r--r--1 root 94 April 16:01 Makefile
user@pcxxxx:~$ Umask
0002
user@pcxxxx:~/debug/test$ LL
Total dosage 16
Drwxrwxr-x 2 User user 4096 April 14 15:43./
Drwxrwxr-x user 4096 April 14 15:32. /
-rw-rw-r--1 User User 97 April 15:43 Makefile
-rw-rw-r--1 User User 82 April 15:37 makefile~