sort 升序 降序 -r reverse 反转 1 sort -n -r number.txt -o number.txt 1 2 3 4 5 6 7 8 9 10 [zookeeper@master rh]$ cat facebook.txt banana:30:5.5 apple:10:2.5 pear:90:2.3 orange:20:3.4 [zookeeper@master rh]$ sort -n -k 2 -t : facebook.txt apple:10:2.5 orange:20:3.4 banana:30:5.5 pear:90:2.3 这个文件有三列,列与列之间用冒号隔开了,第一列