執(zhí)行命令ll


- 當(dāng)文件類型為[* d* ]則是目錄
- 當(dāng)文件類型為[* -* ]則是文件;
- 若文件類型是[* l* ]則表示為鏈接文檔(link file);
- 若文件類型是[* b* ]則表示為裝置文件里面的可供儲(chǔ)存的接口設(shè)備(可隨機(jī)存取裝置);
- 若文件類型是[* c* ]則表示為裝置文件里面的串行端口設(shè)備,例如鍵盤、鼠標(biāo)(一次性讀取裝置)。
權(quán)限解釋(針對目錄):
- 當(dāng)某用戶擁有某目錄r|w|x中任意權(quán)限時(shí)都可以cd 進(jìn)入該目錄
- 當(dāng)某用戶只有擁有某目錄r權(quán)限時(shí)才可以在該目錄中執(zhí)行l(wèi)s等命令
- 當(dāng)某用戶只有擁有某文件r權(quán)限時(shí)才可以對該文件執(zhí)行cat等命令
- 當(dāng)某用戶只有擁有某目錄w權(quán)限時(shí)才可以對該目錄執(zhí)行rm命令,在該目錄中執(zhí)行touch mkdir rm等命令
- 當(dāng)某用戶只有擁有某文件w權(quán)限時(shí)才可以對該文件執(zhí)行編輯/刪除操作
- 在這里舉一個(gè)例子:
某用戶擁有某目錄的x權(quán)限,擁有該目錄下某文件的r權(quán)限,那么如果現(xiàn)在要cat 該文件,則只能在知道該文件名的情況下才能這么操作,因?yàn)樵谠撃夸浵率遣辉试Sread的
[root@localhost tmp]# ll | grep testdir
drwxr-x--x. 2 root root 4096 Dec 4 14:52 testdir
[root@localhost tmp]# cd testdir/
[root@localhost testdir]# ll
total 4
-rw-r--r--. 1 root root 15 Dec 4 11:47 test
[xxjqr@localhost tmp]$ ll | grep testdir
drwxr-x--x. 2 root root 4096 Dec 4 14:52 testdir
[xxjqr@localhost tmp]$ cd testdir/
[xxjqr@localhost testdir]$ ll
ls: cannot open directory .: Permission denied
[xxjqr@localhost testdir]$ cat test
This file is created by the root user
權(quán)限修改:

- u:user
- g:group
- o:other
- a:all
權(quán)限的增加與削減
[root@localhost testdir]# ll
total 4
-r--r--rwx. 1 root root 15 Dec 4 11:47 test
[root@localhost testdir]# chmod ug+x,o-rw test
[root@localhost testdir]# ll
total 4
-r-xr-x--x. 1 root root 15 Dec 4 11:47 test
權(quán)限的數(shù)字設(shè)定
[root@localhost testdir]# ll
total 4
-r-xr-x--x. 1 root root 15 Dec 4 11:47 test
[root@localhost testdir]# chmod 741 test
[root@localhost testdir]# ll
total 4
-rwxr----x. 1 root root 15 Dec 4 11:47 test
修改所屬主與所屬組
[root@localhost testdir]# ll
total 4
-rwxr----x. 1 root root 15 Dec 4 11:47 test
[root@localhost testdir]# chown xxjqr:xxjqr test #更改文件屬主和屬組
[root@localhost testdir]# ll
total 4
-rwxr----x. 1 xxjqr xxjqr 15 Dec 4 11:47 test