NODE_154_length 847 2997
NODE_154_length 3283 4509
NODE_154_length 4672 5715
NODE_154_length 6977 7768
NODE_29_length 3790 4317
NODE_29_length 4356 4712
NODE_29_length 4356 4712
NODE_29_length 158 319
NODE_29_length 1 97
NODE_29_length 1 96
I want the output like:
NODE_154_length 847 2997
NODE_154_length 3283 4509
NODE_154_length 4672 5715
NODE_154_length 6977 7768
NODE_29_length 1 97
NODE_29_length 1 96
NODE_29_length 158 319
NODE_29_length 4356 4712
NODE_29_length 4356 4712
NODE_29_length 3790 4317
OR
NODE_29_length 1 97
NODE_29_length 1 96
NODE_29_length 158 319
NODE_154_length 847 2997
NODE_154_length 3283 4509
NODE_29_length 3790 4317
NODE_29_length 4356 4712
NODE_29_length 4356 4712
NODE_154_length 4672 5715
NODE_154_length 6977 7768
sort -k2,2 file
This sorts all column 2 and gives:
NODE_100_length_46867_cov_66.420166 1 50
NODE_104_length_141_cov_120.127663 1 210
NODE_104_length_141_cov_120.127663 1 210
NODE_104_length_141_cov_120.127663 1 225
This disturbs the complete coordinates for each node.
If I try sort -k2 file
This again gives me weird output, not in sorted manner.
I am not able to understand how to use -k option in Linux. I am using bash, Linux 13.10
sort -k1,1 -k2,2n
orsort -s -k2,2n