sort -t”,” -k 1n,1 -k 3rn,3 file.txt
结果说明:
1.-t 指定文本分隔符
2.-k 指定排序列
3.-n 按数字进行排序
4.-r 翻转排序结果
上面的例子为按第一行正排序,按第三行反排序。