知乎专栏 |
[root@development ~]# umask 0022 [root@development ~]# umask -S u=rwx,g=rx,o=rx
设置
umask 002
chown - change file owner and group
[root@test ~]# touch test [root@test ~]# adduser neo [root@test ~]# chown neo test [root@test ~]# ll test -rw-r--r-- 1 neo root 0 Apr 19 18:15 test
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@test ~]# ll test -rwxr--r-- 1 neo root 0 Apr 19 18:15 test [root@test ~]# chmod g=x test [root@test ~]# ll test -rwx--xr-- 1 neo root 0 Apr 19 18:15 test [root@test ~]# chmod go+w test [root@test ~]# ll test -rwx-wxrw- 1 neo root 0 Apr 19 18:15 test [root@test ~]# chmod u-wx test [root@test ~]# ll test -r---wxrw- 1 neo root 0 Apr 19 18:15 test [root@test ~]# chmod u=rwx test [root@test ~]# ll test -rwx-wxrw- 1 neo root 0 Apr 19 18:15 test [root@test ~]# chmod a=rwx test [root@test ~]# ll test -rwxrwxrwx 1 neo root 0 Apr 19 18:15 test