在工作中有这样的情况,需要显示所有的文件,按照时间先后或者文件大小先后排序显示

命令:ls

1.按时间排序显示文件

1 test`@> ll -rt`


2.按文件大小排序显示文件(文件大小单位:k,M)

1 test`@> ll -Sh`

参数的解释如下:

-r, --reverse reverse order while sorting

-t sort by modification time

-S sort by file size

-h, --human-readable with -l, print sizes in human readable format

(e.g., 1K 234M 2G)

转载自:https://www.cnblogs.com/recognition/p/5329992.html

标签: shell, 排序, 文件大小, 显示文件, ll, readable, human

相关文章推荐

添加新评论,含*的栏目为必填