原创Blog,转载请注明出处
http://blog.csdn.net/hello_hwc?viewmode=contents
权限
对于文件[root@localhost testForCsdn]# ls -l testfile -rw-r----- 1 root root 0 Nov 1 22:14 testfile
[root@localhost testForCsdn]# chmod o=rw testfile [root@localhost testForCsdn]# ls -l testfile -rw-r--rw- 1 root root 0 Nov 1 22:14 testfile
[root@localhost testForCsdn]# chmod o-w testfile [root@localhost testForCsdn]# ls -l testfile -rw-r--r-- 1 root root 0 Nov 1 22:40 testfile
[root@localhost testForCsdn]# chmod g+w testfile [root@localhost testForCsdn]# ls -l testfile -rw-rw-r-- 1 root root 0 Nov 1 22:40 testfile
[root@localhost testForCsdn]# touch test.script [root@localhost testForCsdn]# ls -l test.script -rw-r----- 1 root root 0 Nov 1 22:43 test.script [root@localhost testForCsdn]# chmod 744 test.script [root@localhost testForCsdn]# ls -l test.script -rwxr--r-- 1 root root 0 Nov 1 22:43 test.script
[root@localhost testForCsdn]# useradd hwc [root@localhost testForCsdn]# chown hwc test.script [root@localhost testForCsdn]# ls -l test.script -rwxr--r-- 1 hwc root 0 Nov 1 22:43 test.script
首先添加用户组hwcgroup [root@localhost testForCsdn]# chgrp hwcgroup test.script [root@localhost testForCsdn]# ls -l test.script -rwxr--r-- 1 hwc hwcgroup 0 Nov 1 22:43 test.script
[root@localhost ~]# umask 0022解释下,这里的第一个0是特殊权限位,一般不作考虑
[root@localhost ~]# umask 027 [root@localhost ~]# umask 0027