ls在系統中常用的選項與用法
ls User Commands
(用戶 命令)
ls - list directory contents
(列出目錄的內容)
ls [OPTION]... [FILE]...
(選項) (文件)
~]# ls -a --all do not ignore entries starting with . (.是當前目錄..是上級目錄)
(打開當前目錄下所有包含.開頭的文件或者目錄)
~]# ls -A --almost-all do not list implied . and ..
(打開的當前目錄下不列出.和..的文件或者目錄)
~]# ls -d list directories themselves, not their contents
(打開一個目錄的列表顯示目錄本身,而不顯示內容)
~]# ls -i --inode print the index number of each file
(打開當前目錄下的文件或者目錄的索引號)
~]# ls -l use a long listing format
(打開當前文件或者目錄以長列表格式;顯示額外的信息)
~]# ls -m fill width with a comma separated list of entries
(打開當前所在目錄下以逗號分隔的條目列表)
~]# ls -r --reverse reverse order while sorting
(打開當前所在文件或者目錄;生成時間或者創建時間最早的排第一個 的方式列出格式)
~]# ls -R --recursive list subdirectories recursively
(打開當前目錄或者文件下;遞歸地列出子目錄)
~]# ls -s --size print the allocated size of each file, in blocks
(顯示每個文件或者目錄所分配的塊大小)
~]# ls -S sort by file size
(按照文件大小排序)
~]# ls -t sort by modification time
(按照修改時間排序)
~]# ls -u with -lt: sort by, and show, access time with -l:
show access time and sort by name otherwise:
sortby access time
(配合-t選項;例如~]# ls -ut 按照訪問和修改時間重新排序格式)
~]# ls -U do not sort; list entries in directory order
(不排序,按照文件或者目錄存放順序顯示)
~]# ls -v natural sort of (version) numbers within text
(按照文本中的版本號自然排序)
~]# ls -x list entries by lines instead of by columns
(按行而不是列表的進行排序)
~]# ls -X sort alphabetically by entry extension
(按字母順序進行列表排序)
~]# ls -1 list one file per line
(列出每行一個文件的方式進行排序)
~]# ls -Z Display security context so it fits on most dis-
plays. Displays only mode, user, group, security
context and file name.
(上下顯示用戶、組、安全、文件或者目錄信息)
作者:小馬哥(xiaomag)