# sort text file by first column

Dec 29, 2022

%!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.

↑ up