Sort command
-T
Delimiter number
If this parameter is not specified, spaces are separated by default, and spaces at the beginning and end are ignored. If this parameter is specified, only one character can be recognized. If this parameter is set to a space character, spaces at the beginning and end are not ignored. For example, if a line of content is "X" and no parameter is specified, only one field is considered. If space is specified as the separator, three fields are available, and the first and third fields are empty.
How to enter a tab <tab>? A lot of data uses the <tab> character as the field separator. However, if you enter <tab> In the interactive shell, this character is not displayed, because the default function of <tab> is completion and prompt. The solution is to press ctrl + v, and then press <tab> or ctrl + I to display the <tab> character in the command line.
-K
Specify the sorting Field(Multiple-k parameters can be specified.
Set the comparison priority in the order of appearance)
Each line may be separated by a separator into multiple fields. Which field has a higher priority? The value can be indicated by the-k parameter. And multi-field sorting in Excel.
The parameter is in the form of a number + modifier. Note that the number is based on 1.
-K2 # Compare the second field to the end of the record
-K2.3, 4.5 # starts from the third character of the Second Field and starts from the fifth character of the fourth field.
-K2, 2nr #
Only compare the second field, and regard it as a number, and sort it in inverted order (if it is small to big by default, this is from large to small)