Sorting with Multiple Keys
I've tried Googling.
I've tried searching this forum.
I've done trial and error.
Still can't get it right.
Here's the command I'm using and the results I'm getting. First sort by game name works. Second sort by high score does not.
The secondary sort is not sorting the numbers in reverse numeric order. What am I missing here?
File attached if you want to play along. Spaces in original file are tabs.
[root@zeta ~]# sort -k 2 -k 3,3rn test.txt
Johnny Frogger 123100
Olivia Frogger 133500
Liz Frogger 75700
Danny Galaxian 151300
Corey Galaxian 52310
Sam Galaxian 750
Trump MsPacman 10
Courtney MsPacman 17532
Max Pacman 243200
Rachel Pacman 5700
|