linux中 sort h的作用

1、

root@PC1:/home/test2# ls
b.ped  outcome.map  outcome.ped  xx
root@PC1:/home/test2# du -ah  ## 显示每一个文件的大小
4.0K    ./xx
1.3M    ./outcome.map
1.3G    ./b.ped
158M    ./outcome.ped
1.4G    .
root@PC1:/home/test2# du -ah | sort    ## 直接排序
1.3G    ./b.ped
1.3M    ./outcome.map
1.4G    .
158M    ./outcome.ped
4.0K    ./xx
root@PC1:/home/test2# du -ah | sort -h   ## sort 加 -h参数,-h表示人类可读
4.0K    ./xx
1.3M    ./outcome.map
158M    ./outcome.ped
1.3G    ./b.ped
1.4G    .
原文地址:https://www.cnblogs.com/liujiaxin2018/p/15721511.html