Linux command - umask

2019年06月13日

*

[root@localhost ~]# umask 0
[root@localhost ~]# touch file3
[root@localhost ~]# ls -l file3

-rw-rw-rw-. 1 root root 0 Jun 13 20:32 file3


[root@localhost ~]# umask 0
[root@localhost ~]# ls -al | head -n 3
total 2097180
dr-xr-x---.  2 root root        202 Jun 13 20:41 .
dr-xr-xr-x. 17 root root        224 Jun 11 19:56 ..

[root@localhost ~]# umask 222
[root@localhost ~]# ls -al | head -n 3
total 2097180
dr-xr-x---.  2 root root        202 Jun 13 20:41 .
dr-xr-xr-x. 17 root root        224 Jun 11 19:56 ..

[root@localhost ~]# umask 222
[root@localhost ~]# mkdir test1
[root@localhost ~]# ls -l | grep test1
dr-xr-xr-x. 2 root root          6 Jun 13 20:52 test1
Directories get assigned "rwx" permissions to all sets by default.


*

Category: Linux Tags: public