sort |
---|
|
sort [ options ] [ file(s) ] |
---|
|
Sort input lines into an order determined by the key field and datatype options, and the locale. |
---|
|
-b |
---|
Ignore leading whitespace. |
---|
-c |
---|
Check that input is correctly sorted. There is no output, but the exit code is nonzero if the input is not sorted. |
---|
-d |
---|
Dictionary order: only alphanumerics and whitespace are significant. |
---|
-g |
---|
General numeric value: compare fields as floating-point numbers. This works like -n, except that numbers may have decimal points and exponents (e.g., 6.022e+23). GNU version only. |
---|
-f |
---|
Fold letters implicitly to a common lettercase so that sorting is case-insensitive. |
---|
-i |
---|
Ignore nonprintable characters. |
---|
-k |
---|
Define the sort key field. |
---|
-m |
---|
Merge already-sorted input files into a sorted output stream. |
---|
-n |
---|
Compare fields as integer numbers. |
---|
-o outfile |
---|
Write output to the specified file instead of to standard output. If the file is one of the input files, sort copies it to a temporary file before sorting and writing the output. |
---|
-r |
---|
Reverse the sort order to descending, rather than the default ascending. |
---|
-t char |
---|
Use the single character char as the default field separator, instead of the default of whitespace. |
---|
-u |
---|
Unique records only: discard all but the first record in a group with equal keys. Only the key fields matter: other parts of the discarded records may differ. |
---|
|
sort reads the specified files, or standard input if no files are given, and writes the sorted data on standard output. |
---|