1. Introduction
The sort command sorts the rows in the files specified by the file parameter and writes the results to the standard output. If the file parameter specifies multiple files, the sort command connects the files and sorts them as a file. Sort compares each row of the file as a unit, comparing it to each other, from the first character backwards, sequentially by the ASCII code value, and finally outputting them in ascending order.
2. Command Parameters
-U remove duplicate rows in output line
-F ignores case differences, such as a and a as encoding;
-B ignores the spaces portion of the front;
-M is sorted by the name of the month, such as the sorting method of a few years, DEC, etc.
-n Sorts using pure digits (the default is to sort by text);
-O because sort defaults to output the results to standard output, redirection is required to write the results to a file, in the form of sort filename > newfile;
-R reverse Sort;
-T separator, which by default is delimited by the [tab] key;
K to sort by that interval (field)
3, Example
1 the/ETC/PASSWD account to order
cat/etc/passwd | Sort
Reference: Baidu Library