Linux命令详解之ls命令
前言
- 文章来源:CSDN@LawsonAbs
1.常用参数
-c
参数的作用是:按照文件的修改时间(术语就是ctime)来排序
-c with -lt: sort by, and show, ctime (time of last modification of file status information); with -l: show ctime and sort by name; otherwise: sort by ctime, newest first
- -l 参数的作用是:展示出ctime,并按照文件名进行排序
-l use a long listing format
- -t 参数的作用是:按照修改时间排序,最近修改到最晚修改
-t sort by modification time, newest first
-h
参数:按照k,m,g的方式显示文件的大小,但是如果连k级别都没有到,则不会显示字节后缀。例如:
[root@server4 backup]# ll -h
total 156K
-rw-r--r--. 1 root root 15 Aug 15 21:02 args.txt
-rwxr-xr-x. 1 root root 24 Aug 15 20:58 cecho.sh
-rw-r--r--. 1 littlelawson root 27 Aug 15 20:22 example.txt
-rw-r--r--. 1 littlelawson root 0 Aug 10 19:01 EXAMPLE.txt
-rw-r--r--. 1 littlelawson root 530 Aug 19 11:28 file.txt
-rw-r--r--. 1 root root 136K Aug 19 11:33 hadoop.log
drwxr-xr-x. 2 root root 23 Aug 10 20:05 littlelawson
-rw-r--r--. 1 littlelawson root 0 Aug 10 19:07 little.txt
-rw-r--r--. 1 littlelawson root 0 Aug 10 19:02 new.txt
-rw-r--r--. 1 littlelawson root 0 Aug 10 19:02 some.jpg
-rw-r--r--. 1 littlelawson root 0 Aug 10 19:02 text.pdf
-rw-r--r--. 1 root root 77 Aug 19 11:27 xaa
2.常用组合
根据上面三个参数可以得到许多种的配合:ls -clt
:根据 ctime 进行排序,并输出ctime等信息
ls -cl
: 根据name 进行排序,但是输出文件的ctime
ls -t
与ls -c
的效果是相同的
还没有评论,来说两句吧...