[root@kedacom wyl]# cat personzhangsan student 21lisi teacher 30xiao teacher 30wanger student 20guo teacher 9#对文件的行进行排序输出,默认为升序[root@kedacom wyl]# sort personguo teacher 9lisi teacher 30wanger student 20xiao teacher 30zhangsan student 21#对文件的行进行降序输出[root@kedacom wyl]# sort -r personzhangsan student 21xiao teacher 30wanger student 20lisi teacher 30guo teacher 9#使用空格对文件进行分割,使用第三列进行排序,默认按字符排序[root@kedacom wyl]# sort -t" " -k3 personwanger student 20zhangsan student 21lisi teacher 30xiao teacher 30guo teacher 9#使用空格对文件进行分割,使用第三列进行排序,去除重复的行[root@kedacom wyl]# sort -t" " -k3 -u personwanger student 20zhangsan student 21lisi teacher 30guo teacher 9#使用空格对文件进行分割,使用第三列进行排序,按数值进行排序[root@kedacom wyl]# sort -t" " -k3 -n personguo teacher 9wanger student 20zhangsan student 21lisi teacher 30xiao teacher 30