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

 

posted @ 2021-01-30 11:45  小鲨鱼2018  阅读(293)  评论(0编辑  收藏  举报