linux 中 sort -h选项
-h:使用易读性数字,比如 K, G单位。
001、
[root@PC1 test02]# ls a.txt [root@PC1 test02]# cat a.txt ## 测试数据 2G 3K 4K 1G [root@PC1 test02]# sort a.txt 1G 2G 3K 4K [root@PC1 test02]# sort -n a.txt 1G 2G 3K 4K [root@PC1 test02]# sort -h a.txt ## 按照易读性数字排序 3K 4K 1G 2G

。

浙公网安备 33010602011771号