34 Linux的sort命令
sort [OPTION]... --files0-from=F
LiSi:Chinese:80:Math:71:English:85
WangWu:Chinese:60:Math:71:English:100
ZhaoLiu:Chinese:56:Math:41:English:74
SunQi:Chinese:100:Math:91:English:100
ZhaoLiu:Chinese:56:Math:41:English:74
LiSi:Chinese:80:Math:71:English:85
SunQi:Chinese:100:Math:91:English:100
WangWu:Chinese:60:Math:71:English:100
ZhangSan:Chinese:80:Math:91:English:100
ZhaoLiu:Chinese:56:Math:41:English:74
ZhaoLiu:Chinese:56:Math:41:English:74
SunQi:Chinese:100:Math:91:English:100
ZhaoLiu:Chinese:56:Math:41:English:74
ZhaoLiu:Chinese:56:Math:41:English:74
WangWu:Chinese:60:Math:71:English:100
LiSi:Chinese:80:Math:71:English:85
ZhangSan:Chinese:80:Math:91:English:100
alloy@raspberrypi:~/linuxshell/chapter5$ sort -k3 -n -t: score
ZhaoLiu:Chinese:56:Math:41:English:74
ZhaoLiu:Chinese:56:Math:41:English:74
WangWu:Chinese:60:Math:71:English:100
LiSi:Chinese:80:Math:71:English:85
ZhangSan:Chinese:80:Math:91:English:100
SunQi:Chinese:100:Math:91:English:100
alloy@raspberrypi:~/linuxshell/chapter5$ sort -k3 -n -r -t: score
SunQi:Chinese:100:Math:91:English:100
ZhangSan:Chinese:80:Math:91:English:100
LiSi:Chinese:80:Math:71:English:85
WangWu:Chinese:60:Math:71:English:100
ZhaoLiu:Chinese:56:Math:41:English:74
ZhaoLiu:Chinese:56:Math:41:English:74
SunQi:Chinese:100:Math:91:English:100
ZhangSan:Chinese:80:Math:91:English:100
WangWu:Chinese:60:Math:71:English:100
ZhaoLiu:Chinese:56:Math:41:English:74
alloy@raspberrypi:~/linuxshell/chapter5$ sort -k3 -n -r -t: score -o scoresortoutput
alloy@raspberrypi:~/linuxshell/chapter5$ cat scoresortoutput
SunQi:Chinese:100:Math:91:English:100
ZhangSan:Chinese:80:Math:91:English:100
LiSi:Chinese:80:Math:71:English:85
WangWu:Chinese:60:Math:71:English:100
ZhaoLiu:Chinese:56:Math:41:English:74
ZhaoLiu:Chinese:56:Math:41:English:74
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。