I have a file of three columns:
1 A 0.5
2 B 0.7
3 A 10
4 C 4
5 B 4
I want to sort the file by increasing order of column 3 and group by column 2
1 A 0.5
3 A 10
2 B 0.7
5 B 4
4 C 4
I know how to sort only based on the 3rd column :
sort -k3,3 file
But can we group by the second column ?
sort -k2,2 -k3,3n file
should do