linux用8位二进制来标识权限,三位一组。二进制应该是大学时代微机原理教的吧?
1-001 2-010 3-011 4-100 5-101 6-110 7-111
所以 chmod 777 文件名,就等于把所有权限给设置成1 了。
具体每一位权限什么意思,参见下表
Number Permission Type `Symbol`
0 No Permission `---`
1 Execute `--x`
2 Write `-w-`
3 Execute + Write `-wx`
4 Read `r--`
5 Read + Execute `r-x`
6 Read + Write `rw-`
7 Read + Write + Execute `rwx`
在Linux文件系统中 ls -l 文件名,我们可以看到
dell@GAME:/etc/apache2/mods-enabled$ ls -l wsgi.load
-rwxrwxrwt 1 root root 56 May 3 13:50 wsgi.load
具体的意义可以在下表中查询到。
l = Link to another file
d = a directory
- = file
r = read permission - Read the file
w = write permission - Write or edit the file
x = execute permission He can execute the file
- = no permission