数据如下:
Web Application Attack: 1361698
Network Trojan was detected: 3272
Potentially Bad Traffic: 0
Misc activity: 0
Detection of Network Scan: 0
我正在寻找一个按行号排序的命令,我尝试过的任何东西都没有用。
答案 0 :(得分:4)
试试这个:
sort -n -r -t':' -k2,2 <data_file>
说明:
-n: Numeric sort
-r: Reverse (descending)
-t: Changes field separator to ':' character
-k: Sort key starts on field 2 and ends on field 2