linux的ls命令详解(三)(几种常用的ls选项排序命令)

xiaoxiao2021-02-28  137

上一章提到了-s(小写)选项,其实还有-S(大写)选项,并且这两个选项的用法是有所不同的,大写-S选项其实就是小写-s的加强版--排序版:

让我们把这两个选项对比一下:

ls -a -s 总用量 18044     0 .                          3976 bugzilla.tar            4 start1     4 ..                           20 LinuxVarLog-xiangjie.txt      4 start4     0 apache-tomca                    4 s1                            0 start日志 14020 apache-tomcat.tar      4 s2     4 bugzilla                4 start0822

ls -a -S -s 总用量 18044 14020 apache-tomcat.tar        0 .                         4 start4  3976 bugzilla.tar                     0 apache-tomcat     4 s1    20 LinuxVarLog-xiangjie.txt      4 start0822                 0 start日志     4 ..                            4 s2     4 bugzilla                4 start1

   -t  选项,按照更新时间排序,最新的排在最前面: ls -a -t ..           
转载请注明原文地址: https://www.6miu.com/read-22488.html

最新回复(0)