# ls –l httpd.conf
-rwxr-xr-x 1 root admin 34890 10月19 20:17 httpd.conf
文件模式(mode),占9位
文件类型(type),占一位
文件连接位数(count)
文件属组(group)
文件属主(user)
以字节计的文件长度(size)
文件最后更改时间(time)
文件名(name)
符号连接(s_link)
# ls –l httpd.conf
lrwxr-xr-x 1 root admin 34890 10月19 20:17 httpd.conf->;/home/file.txt
前三位:rwx:它的所有者是root,即就是文件所有者,它对这个文件的权限是读写执行
中间三位:r-x:表示admin组中其它用户对这个文件的权限是读和执行
后面位:r-x:就是即不是所有者,也不是属组的对文件的权限是读和执行
# chmod 755 httpd.conf
4 0 0 文件属主可读
2 0 0 文件属主可写
1 0 0 文件属主可执行
0 4 0 属组用户可读
0 2 0 属组用户可写
0 1 0 属组用户可执行
0 0 4 其他用户可读
0 0 2 其他用户可写
0 0 1 其他用户可执行
文件属主:r w x:4 + 2 + 1
属组用户:r w x:4 + 2 + 1
其他用户:r w x:4 + 2 + 1
文件属主:4+2+1=7
属组用户:4+0+1=5
其他用户:4+0+1=5
# chmod g+x aaa.txt
# ls –l /home
drwxr-xr-x 5 root root 4096 4月 18 16:57 home
.
..
drwx------ 1 hlj hlj
4096 4月 15 14:23 aaa
drwxr-xr-x 1 root root
4096 4月 16 18:49 bbb
drwx------ 9 pub pub
4096 4月 13 21:22 ccc
# ls –l httpd.conf
-rwxr-xr-x 1 root admin 34890 10月19 20:17 httpd.conf
# ln –s /home/file.txt /home/httpd.conf
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |