sort on multiple columns

Howdy!

Need to sort a large .txt file containing the following, using sort. First based on the 1st column, and then on the 2nd column:

Group01.01	1000500	31	0.913	-1.522974494
Group01.01	1001500	16	0.684	-0.967496041
Group01.01	36500	19	0.476	na
Group01.02	365500	15	0.400	na
Group01.02	366500	7	0.327	na
Group01.03	367500	19	0.577	na
Group01.03	368500	27	0.862	-2.009239044
Group01.04	369500	18	0.976	-2.482836837

I tried using

sort -k1 -k2n

but it does not work. Any ideas? Thanks a million!

---------- Post updated at 09:53 PM ---------- Previous update was at 09:47 PM ----------

THis actually did the trick

sort -k 1,1 -k2,2n 
3 Likes

Thanks for informing us...