Mohit Arora Mohit Arora - 1 year ago 115
Bash Question

Unix sorting mutiple conditions

I have a file in which there are numbers like

and so on

I want them to be groped/sorted as

Basically EH ones together in ascending then C together in ascending and then the rest in ascending.

I am trying
sort -k 1.10,1.14 -nr | sort -k 1.13 -r
but not getting the exact output.

Any help would be much appreciated. Thanks in advance

Answer Source

Will this work for you sort -r -t. -k5.4 somefile.txt

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download