sort text file by first column
last updated: Oct 20, 2023
%!sort -n
-n
here means "sort numerically", as opposed to lexically.
If you wanted to sort by the second column, for example, you might do:
%!sort -n -k2
To reverse the sort, use -r
or --reverse
. See the man page for more.