標籤:
現在查看一個檔案的資訊
[email protected]:/home/songl/test# ls -l a.out -rwxrwxr-x 1 songl songl 8565 May 5 07:45 a.out
| - rwx rwx r-x |
1 |
songl |
songl |
8565 May 5 07:45 |
a.out |
| 檔案許可權和類型 |
inode串連數 |
所有者 |
所屬使用者組 |
時間 |
檔案名稱 |
| 更改指令chmod |
|
更該指令chown |
更該指令chgrp |
|
|
一般來說訪問檔案的身份有:
1、檔案所有者(owner)
2、使用者組(group)
3、其它人(others)
| - |
rwx |
rwx |
r-x |
| 表示檔案 |
所有者許可權 |
所屬使用者權限 |
其它使用者權限 |
改變檔案屬性的方法:
1、chgrp [-R] dir/file 改變檔案所屬使用者組,加上-R則連同子目錄下的所有檔案和目錄都更新
2、chown [-R] dir/file 改變檔案的所有者,加上-R則連同子目錄下的所有檔案和目錄都更新
3、chomd [-R] abc dir/file 更改不同使用者的讀寫執行許可權
[email protected]:/home/songl/test# ls -l a.out -rwxrwxr-x 1 songl songl 8565 May 5 07:45 a.out[email protected]:/home/songl/test# chmod g-w a.out [email protected]:/home/songl/test# ls -l a.out -rwxr-xr-x 1 songl songl 8565 May 5 07:45 a.out[email protected]:/home/songl/test# chown root a.out [email protected]:/home/songl/test# ls -l a.out -rwxr-xr-x 1 root songl 8565 May 5 07:45 a.out[email protected]:/home/songl/test# chgrp root a.out [email protected]:/home/songl/test# ls -l a.out -rwxr-xr-x 1 root root 8565 May 5 07:45 a.out
Linux之檔案許可權