Sort command using unix

Hello,

I have a file with 'tab' separated columns. The first column of the file contains integer values. Now I want to sort the first column in ascending order.

Can someone help me on this...

thanks in advance

This will sort the file:

sort -k 1n,1 input-file >output-file

If you want only column one in the output:

awk '{print $1;}' input-file |sort -k 1n,1 >output-file
1 Like