Re: sort

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sort, the contents of infile1, placing
     the output in outfile and using the first two characters of the second
     field as the sort key:

cat  infile1 |  awk '{if(NR >1) print $0}' | sort -o outfile -k 1

BTW awk tick off caption " name  age  income" line at the begin of file

2006/6/18, Aimin Yan <aiminy@xxxxxxxxxxx>:
i have a file, I want to sort this file based on the 2nd column, and start
from 1st row.how can
I do use sort command to do in redhat linux.
for example, this is file I want to sort


name  age  income
trorry   34    344
aimin   36    345
shihe   23    3667

Aimin

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux