版权声明:作者-傲娇天子 博文主页地址:https://blog.csdn.net/qq_41116956 欢迎转载,转载请在文章页面明显位置给出原文链接,谢谢 https://blog.csdn.net/qq_41116956/article/details/82877879
- 按时间排序:
[root@localhost ~]# ls -lt
总用量 968
drwxr-xr-x. 5 root root 47 9月 28 09:53 tar
drwxr-xr-x. 9 yasuo yasuo 4096 9月 21 15:48 nginx-1.12.2
-rw-r--r--. 1 root root 981687 9月 21 15:47 nginx-1.12.2.tar.gz
drwxr-xr-x. 3 root root 44 9月 21 10:56 1
drwxr-xr-x. 2 root root 6 9月 20 15:48 公共
drwxr-xr-x. 2 root root 6 9月 20 15:48 模板
drwxr-xr-x. 2 root root 6 9月 20 15:48 视频
drwxr-xr-x. 2 root root 6 9月 20 15:48 图片
drwxr-xr-x. 2 root root 6 9月 20 15:48 文档
drwxr-xr-x. 2 root root 6 9月 20 15:48 下载
drwxr-xr-x. 2 root root 6 9月 20 15:48 音乐
drwxr-xr-x. 2 root root 6 9月 20 15:48 桌面
-rw-------. 1 root root 1456 9月 14 19:49 anaconda-ks.cfg
加上-r是反向排序:
[root@localhost ~]# ls -ltr
总用量 968
-rw-------. 1 root root 1456 9月 14 19:49 anaconda-ks.cfg
drwxr-xr-x. 2 root root 6 9月 20 15:48 桌面
drwxr-xr-x. 2 root root 6 9月 20 15:48 音乐
drwxr-xr-x. 2 root root 6 9月 20 15:48 下载
drwxr-xr-x. 2 root root 6 9月 20 15:48 文档
drwxr-xr-x. 2 root root 6 9月 20 15:48 图片
drwxr-xr-x. 2 root root 6 9月 20 15:48 视频
drwxr-xr-x. 2 root root 6 9月 20 15:48 模板
drwxr-xr-x. 2 root root 6 9月 20 15:48 公共
drwxr-xr-x. 3 root root 44 9月 21 10:56 1
-rw-r--r--. 1 root root 981687 9月 21 15:47 nginx-1.12.2.tar.gz
drwxr-xr-x. 9 yasuo yasuo 4096 9月 21 15:48 nginx-1.12.2
drwxr-xr-x. 5 root root 47 9月 28 09:53 tar
- 按大小排序:
[root@localhost ~]# ls -lS
总用量 968
-rw-r--r--. 1 root root 981687 9月 21 15:47 nginx-1.12.2.tar.gz
drwxr-xr-x. 9 yasuo yasuo 4096 9月 21 15:48 nginx-1.12.2
-rw-------. 1 root root 1456 9月 14 19:49 anaconda-ks.cfg
drwxr-xr-x. 5 root root 47 9月 28 09:53 tar
drwxr-xr-x. 3 root root 44 9月 21 10:56 1
drwxr-xr-x. 2 root root 6 9月 20 15:48 公共
drwxr-xr-x. 2 root root 6 9月 20 15:48 模板
drwxr-xr-x. 2 root root 6 9月 20 15:48 视频
drwxr-xr-x. 2 root root 6 9月 20 15:48 图片
drwxr-xr-x. 2 root root 6 9月 20 15:48 文档
drwxr-xr-x. 2 root root 6 9月 20 15:48 下载
drwxr-xr-x. 2 root root 6 9月 20 15:48 音乐
drwxr-xr-x. 2 root root 6 9月 20 15:48 桌面
加上-h是带单位显示文件大小:
[root@localhost ~]# ls -lSh
总用量 968K
-rw-r--r--. 1 root root 959K 9月 21 15:47 nginx-1.12.2.tar.gz
drwxr-xr-x. 9 yasuo yasuo 4.0K 9月 21 15:48 nginx-1.12.2
-rw-------. 1 root root 1.5K 9月 14 19:49 anaconda-ks.cfg
drwxr-xr-x. 5 root root 47 9月 28 09:53 tar
drwxr-xr-x. 3 root root 44 9月 21 10:56 1
drwxr-xr-x. 2 root root 6 9月 20 15:48 公共
drwxr-xr-x. 2 root root 6 9月 20 15:48 模板
drwxr-xr-x. 2 root root 6 9月 20 15:48 视频
drwxr-xr-x. 2 root root 6 9月 20 15:48 图片
drwxr-xr-x. 2 root root 6 9月 20 15:48 文档
drwxr-xr-x. 2 root root 6 9月 20 15:48 下载
drwxr-xr-x. 2 root root 6 9月 20 15:48 音乐
drwxr-xr-x. 2 root root 6 9月 20 15:48 桌面