我有以下文件:
# cat /var/data/wlan_cells.log
"Tech 1" "57" "-67" "0"
"GUEST01" "52" "-69" "0"
"SWSGP01" "52" "-69" "0"
"GateAP" "100" "-39" "0"
"AP_9 test" "78" "-59" "0"
"surf" "13" "-85" "0"
"Tech 2" "18" "-83" "0"
如何按信号质量(第二个值)对线进行排序? 预期结果:
# cat /var/data/wlan_cells.log
"GateAP" "100" "-39" "0"
"AP_9 test" "78" "-59" "0"
"Tech 1" "57" "-67" "0"
"GUEST01" "52" "-69" "0"
"SWSGP01" "52" "-69" "0"
"Tech 2" "18" "-83" "0"
"surf" "13" "-85" "0"
答案 0 :(得分:5)
我使用
sort -t\" -k4nr
即。按"
拆分为列,使用第四列,按相反顺序按数字排序。