ls
列出當(dāng)前目錄中的內(nèi)容。
ls -a
列出文件下所有的文件,包括以 . 開頭的隱藏文件(linux下文件隱藏文件是以 . 開頭的,如果存在 .. 代表存在著父目錄)。
ls -A
列出除了 . 和 .. 以外的文件。
ls -F
在每一個文件的末尾加上一個字符說明該文件的類型:
-
*表示可執(zhí)行文件 Executable file -
@表示符號鏈接 Link file -
|表示 Pipe file -
/表示目錄 folder -
=表示套接字 Socket file
ls -s
在每個文件的后面打印出文件的大小。
ls -S
按文件的大小進(jìn)行排序。
ls -t
按文件的時間進(jìn)行排序。
ls -R
將目錄下所有的子目錄的文件都列出來。
ls -L
列出文件的鏈接名。
ls -l
顯示詳細(xì)信息,例如:
> ls -l
total 28
-rw-rw-r– 1 surendra surendra 0 Feb 10 19:32 99abc.txt
-rwxrwxr-x 1 surendra surendra 365 May 12 2015 fpga_build.sh
-rw-rw-r– 1 surendra surendra 663 Aug 24 20:37 startup_script.sh
drwxrwxr-x 2 surendra surendra 16384 Aug 23 18:30 temp
-rwxr-xr-x 1 root root 80 Aug 4 2015 wifiactivate.sh
第一行:total 28 表示當(dāng)前目錄的大小 Size,單位為 bytes
Note: Do not consider this as actual folder size, this is actual size of files + each folder block size(4k).
后續(xù)行:例如
-rw-rw-r– 1 surendra surendra 0 Feb 10 19:32 99abc.txt
-
field 1:
- 第一個字符:文件的類型
- 后面的9個字符:文件的權(quán)限 owner - group - world
field 2:Links. This field represents number of file links to the given file. If you see link as 2, that indicates we can access two more files/folders when you access this file.
field 3:Owner 擁有者
field 4:Group 組
field 5:Size in bytes 大小
field 6:修改時間,月份
Febfield 7:修改時間,日期
10field 8:修改時間,時間
19:32field 9:文件名