| 知乎专栏 |
[root@development ~]# umask 0022 [root@development ~]# umask -S u=rwx,g=rx,o=rx
设置
umask 002
chown - change file owner and group
[root@netkiller ~]# touch netkiller [root@netkiller ~]# adduser neo [root@netkiller ~]# chown neo netkiller [root@netkiller ~]# ll netkiller -rw-r--r-- 1 neo root 0 Apr 19 18:15 netkiller
chgrp - change group ownership
# chgrp daemon -R * # ll drwxrwxr-x 3 neo daemon 4096 Apr 16 18:23 user
option
u = user g = group o = other a = all r = 4 w = 2 x = 1
[root@netkiller ~]# ll netkiller -rwxr--r-- 1 neo root 0 Apr 19 18:15 netkiller [root@netkiller ~]# chmod g=x netkiller [root@netkiller ~]# ll netkiller -rwx--xr-- 1 neo root 0 Apr 19 18:15 netkiller [root@netkiller ~]# chmod go+w netkiller [root@netkiller ~]# ll netkiller -rwx-wxrw- 1 neo root 0 Apr 19 18:15 netkiller [root@netkiller ~]# chmod u-wx netkiller [root@netkiller ~]# ll netkiller -r---wxrw- 1 neo root 0 Apr 19 18:15 netkiller [root@netkiller ~]# chmod u=rwx netkiller [root@netkiller ~]# ll netkiller -rwx-wxrw- 1 neo root 0 Apr 19 18:15 netkiller [root@netkiller ~]# chmod a=rwx netkiller [root@netkiller ~]# ll netkiller -rwxrwxrwx 1 neo root 0 Apr 19 18:15 netkiller