您的位置:首页 > 其它

ls在系统中常用的选项与用法

2016-07-28 21:13 465 查看
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)

本文出自 “小马哥Linux系统运维” 博客,转载请与作者联系!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: