How to sort lines in a text file from the terminal?
Nam GPA Something
xyz 3.4 99
pqr 4.5 23
abc 5.6 44
dcd 4.4 22
edr 2.2 78
If you have a file like above. You can use the command below to sort by GPA. (change the key to sort by any field : '-k value')
sort -k 2 filename
If you want the reverse order use -r option
sort -r -k 2 filename
PuTTy is just the program used to connect to a computer.
There's a lovely command called sort
you may wish to try.
Another man
for manual, will give you all sorts of good information.
Try man sort
or even the manual for the manual man man
.