Last active
March 17, 2017 05:05
-
-
Save amagee/4011434a611a127964b8b5c581a3e7f2 to your computer and use it in GitHub Desktop.
Linux sort by column
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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