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    .

 

相关文章

Centos系统之Shell编程基础知识
从Export理解Shell环境和变量生存期
linux shell数组变量、类型及规则
Centos编程Shell基本工作原理方案
Centos操作系统编程之Shell 问答录
rsync-linux备份脚本