Article 567TP [SOLVED] Sorting with Multiple Keys

[SOLVED] Sorting with Multiple Keys

by
spellinator
from LinuxQuestions.org on (#567TP)
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
Attached Files
txt.giftest.txt (201 Bytes)
latest?d=yIl2AUoC8zA latest?i=eckqrEUQUQE:PhseIJlqXDU:F7zBnMy latest?i=eckqrEUQUQE:PhseIJlqXDU:V_sGLiP latest?d=qj6IDK7rITs latest?i=eckqrEUQUQE:PhseIJlqXDU:gIN9vFweckqrEUQUQE
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments