Skip to content

Instantly share code, notes, and snippets.

@amagee
Last active March 17, 2017 05:05
Show Gist options
  • Save amagee/4011434a611a127964b8b5c581a3e7f2 to your computer and use it in GitHub Desktop.
Save amagee/4011434a611a127964b8b5c581a3e7f2 to your computer and use it in GitHub Desktop.
Linux sort by column
cat file |sort -k3nr
# -n -- sort numerically (not lexicographically)
# -k3 -- sort by the 3rd column
# -r -- sort in reverse order (bigger values first)
This is different to |sort -nk3r for some reason
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment