Linux sort details (sort on scientific notation)

Source: Internet
Author: User

1. Parameter interpretation

-T Set delimiter
-K Set comparison fields (columns)
-N Compare by number
-G Comparison of scientific notation methods
-O Set output file, compared with ">" can set output to the original file, ">" will empty the original file
-R Descending (big-to-small) arrangement
-U Delete a peer

2. Example Demo

1 File Contents2[@ibi-Genome temp]$ Cat Temp3 1:34 2:45 1:26 7Use-k-t to specify columns (2) and separators (:)8[@ibi-genome temp]$Sort-k2-t':'Temp9 Ten:1Ten 1:2 One 1:3 A 2:4
1Usen Specifies to sort numerically2 3& When not used-n is sorted by default in ASCII4[@ibi-genome temp]$Sort-k2-t':'Temp5 Ten:16 1:27 1:38 2:49& Use-NTen[@ibi-genome temp]$Sort-k1n-t':'Temp One 1:2 A 1:3 - 2:4 - Ten:1 the  -User Options (Descending sort, default ascending order) -[Jinz@ibi-genome temp]$Sort-k1nr-t':'Temp - Ten:1 + 2:4 - 1:2 + 1:3

Linux sort details (sort on scientific notation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.