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)