I have a file which looks roughly like this:
996 mmmmmmm
996 xxxxxxxxxxxxx
99600 ssssssssss
9964 fffffffffffff
and would like to sort it numerically on the first field. I tried:
sort -nr --key=1 ....
The output I get is:
99600 ssssssssss
9964 fffffffffffff
996 mmmmmmm
996 xxxxxxxxxxxxx
The output I would like to have:
996 mmmmmmm
996 xxxxxxxxxxxxx
9964 fffffffffffff
99600 ssssssssss
Of course I can solve this by writing a one-liner in, say, Perl or Ruby, but I wonder why my approach had not worked, and how I can use the genuine 'sort' command to achieve my goal.