Example file.txt
:
100 foo
2 bar
300 tuu
When using sort -k 1,1 file.txt
, the order of lines will not change, though we are expecting :
2 bar
100 foo
300 tuu
How to sort a field consisting of numbers based on the absolute numerical value?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…