linux系统中将文件按照大小进行排序

1、

[root@PC3 sheep]# ls
a.ped  result.map  result.ped  tr.map
[root@PC3 sheep]# ls -S | xargs -n 1 du -sh   ## 从大致小进行排序
829M    result.ped
204M    a.ped
20M     result.map
7.4M    tr.map
[root@PC3 sheep]# ls -S | xargs -n 1 du -sh | tac  ## 从小至大进行排序
7.4M    tr.map
20M     result.map
204M    a.ped
829M    result.ped
原文地址:https://www.cnblogs.com/liujiaxin2018/p/14348521.html