| 1 |
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.50.1. |
| 2 |
.TH SORT "1" "June 2025" "GNU coreutils 9.7" "User Commands" |
| 3 |
.SH NAME |
| 4 |
sort \- sort lines of text files |
| 5 |
.SH SYNOPSIS |
| 6 |
.B sort |
| 7 |
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]... |
| 8 |
.br |
| 9 |
.B sort |
| 10 |
[\fI\,OPTION\/\fR]... \fI\,--files0-from=F\/\fR |
| 11 |
.SH DESCRIPTION |
| 12 |
.\" Add any additional description here |
| 13 |
.PP |
| 14 |
Write sorted concatenation of all FILE(s) to standard output. |
| 15 |
.PP |
| 16 |
With no FILE, or when FILE is \-, read standard input. |
| 17 |
.PP |
| 18 |
Mandatory arguments to long options are mandatory for short options too. |
| 19 |
Ordering options: |
| 20 |
.TP |
| 21 |
\fB\-b\fR, \fB\-\-ignore\-leading\-blanks\fR |
| 22 |
ignore leading blanks |
| 23 |
.TP |
| 24 |
\fB\-d\fR, \fB\-\-dictionary\-order\fR |
| 25 |
consider only blanks and alphanumeric characters |
| 26 |
.TP |
| 27 |
\fB\-f\fR, \fB\-\-ignore\-case\fR |
| 28 |
fold lower case to upper case characters |
| 29 |
.TP |
| 30 |
\fB\-g\fR, \fB\-\-general\-numeric\-sort\fR |
| 31 |
compare according to general numerical value |
| 32 |
.TP |
| 33 |
\fB\-i\fR, \fB\-\-ignore\-nonprinting\fR |
| 34 |
consider only printable characters |
| 35 |
.TP |
| 36 |
\fB\-M\fR, \fB\-\-month\-sort\fR |
| 37 |
compare (unknown) < 'JAN' < ... < 'DEC' |
| 38 |
.TP |
| 39 |
\fB\-h\fR, \fB\-\-human\-numeric\-sort\fR |
| 40 |
compare human readable numbers (e.g., 2K 1G) |
| 41 |
.TP |
| 42 |
\fB\-n\fR, \fB\-\-numeric\-sort\fR |
| 43 |
compare according to string numerical value; |
| 44 |
see full documentation for supported strings |
| 45 |
.TP |
| 46 |
\fB\-R\fR, \fB\-\-random\-sort\fR |
| 47 |
shuffle, but group identical keys. See \fBshuf\fP(1) |
| 48 |
.TP |
| 49 |
\fB\-\-random\-source\fR=\fI\,FILE\/\fR |
| 50 |
get random bytes from FILE |
| 51 |
.TP |
| 52 |
\fB\-r\fR, \fB\-\-reverse\fR |
| 53 |
reverse the result of comparisons |
| 54 |
.TP |
| 55 |
\fB\-\-sort\fR=\fI\,WORD\/\fR |
| 56 |
sort according to WORD: |
| 57 |
general\-numeric \fB\-g\fR, human\-numeric \fB\-h\fR, month \fB\-M\fR, |
| 58 |
numeric \fB\-n\fR, random \fB\-R\fR, version \fB\-V\fR |
| 59 |
.TP |
| 60 |
\fB\-V\fR, \fB\-\-version\-sort\fR |
| 61 |
natural sort of (version) numbers within text |
| 62 |
.PP |
| 63 |
Other options: |
| 64 |
.TP |
| 65 |
\fB\-\-batch\-size\fR=\fI\,NMERGE\/\fR |
| 66 |
merge at most NMERGE inputs at once; |
| 67 |
for more use temp files |
| 68 |
.TP |
| 69 |
\fB\-c\fR, \fB\-\-check\fR, \fB\-\-check\fR=\fI\,diagnose\-first\/\fR |
| 70 |
check for sorted input; do not sort |
| 71 |
.TP |
| 72 |
\fB\-C\fR, \fB\-\-check\fR=\fI\,quiet\/\fR, \fB\-\-check\fR=\fI\,silent\/\fR |
| 73 |
like \fB\-c\fR, but do not report first bad line |
| 74 |
.TP |
| 75 |
\fB\-\-compress\-program\fR=\fI\,PROG\/\fR |
| 76 |
compress temporaries with PROG; |
| 77 |
decompress them with PROG \fB\-d\fR |
| 78 |
.TP |
| 79 |
\fB\-\-debug\fR |
| 80 |
annotate the part of the line used to sort, |
| 81 |
and warn about questionable usage to stderr |
| 82 |
.TP |
| 83 |
\fB\-\-files0\-from\fR=\fI\,F\/\fR |
| 84 |
read input from the files specified by |
| 85 |
NUL\-terminated names in file F; |
| 86 |
If F is \- then read names from standard input |
| 87 |
.TP |
| 88 |
\fB\-k\fR, \fB\-\-key\fR=\fI\,KEYDEF\/\fR |
| 89 |
sort via a key; KEYDEF gives location and type |
| 90 |
.TP |
| 91 |
\fB\-m\fR, \fB\-\-merge\fR |
| 92 |
merge already sorted files; do not sort |
| 93 |
.TP |
| 94 |
\fB\-o\fR, \fB\-\-output\fR=\fI\,FILE\/\fR |
| 95 |
write result to FILE instead of standard output |
| 96 |
.TP |
| 97 |
\fB\-s\fR, \fB\-\-stable\fR |
| 98 |
stabilize sort by disabling last\-resort comparison |
| 99 |
.TP |
| 100 |
\fB\-S\fR, \fB\-\-buffer\-size\fR=\fI\,SIZE\/\fR |
| 101 |
use SIZE for main memory buffer |
| 102 |
.TP |
| 103 |
\fB\-t\fR, \fB\-\-field\-separator\fR=\fI\,SEP\/\fR |
| 104 |
use SEP instead of non\-blank to blank transition |
| 105 |
.TP |
| 106 |
\fB\-T\fR, \fB\-\-temporary\-directory\fR=\fI\,DIR\/\fR |
| 107 |
use DIR for temporaries, not $TMPDIR or \fI\,/tmp\/\fP; |
| 108 |
multiple options specify multiple directories |
| 109 |
.TP |
| 110 |
\fB\-\-parallel\fR=\fI\,N\/\fR |
| 111 |
change the number of sorts run concurrently to N |
| 112 |
.TP |
| 113 |
\fB\-u\fR, \fB\-\-unique\fR |
| 114 |
output only the first of lines with equal keys; |
| 115 |
with \fB\-c\fR, check for strict ordering |
| 116 |
.TP |
| 117 |
\fB\-z\fR, \fB\-\-zero\-terminated\fR |
| 118 |
line delimiter is NUL, not newline |
| 119 |
.TP |
| 120 |
\fB\-\-help\fR |
| 121 |
display this help and exit |
| 122 |
.TP |
| 123 |
\fB\-\-version\fR |
| 124 |
output version information and exit |
| 125 |
.PP |
| 126 |
KEYDEF is F[.C][OPTS][,F[.C][OPTS]] for start and stop position, where F is a |
| 127 |
field number and C a character position in the field; both are origin 1, and |
| 128 |
the stop position defaults to the line's end. If neither \fB\-t\fR nor \fB\-b\fR is in |
| 129 |
effect, characters in a field are counted from the beginning of the preceding |
| 130 |
whitespace. OPTS is one or more single\-letter ordering options [bdfgiMhnRrV], |
| 131 |
which override global ordering options for that key. If no key is given, use |
| 132 |
the entire line as the key. Use \fB\-\-debug\fR to diagnose incorrect key usage. |
| 133 |
.PP |
| 134 |
SIZE may be followed by the following multiplicative suffixes: |
| 135 |
% 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y, R, Q. |
| 136 |
.PP |
| 137 |
*** WARNING *** |
| 138 |
The locale specified by the environment affects sort order. |
| 139 |
Set LC_ALL=C to get the traditional sort order that uses |
| 140 |
native byte values. |
| 141 |
.SH AUTHOR |
| 142 |
Written by Mike Haertel and Paul Eggert. |
| 143 |
.SH "REPORTING BUGS" |
| 144 |
GNU coreutils online help: <https://www.gnu.org/software/coreutils/> |
| 145 |
.br |
| 146 |
Report any translation bugs to <https://translationproject.org/team/> |
| 147 |
.SH "SEE ALSO" |
| 148 |
\fBshuf\fP(1), \fBuniq\fP(1) |
| 149 |
.PP |
| 150 |
.br |
| 151 |
Full documentation <https://www.gnu.org/software/coreutils/sort> |
| 152 |
.br |
| 153 |
or available locally via: info \(aq(coreutils) sort invocation\(aq |
| 154 |
.PP |
| 155 |
.br |
| 156 |
Packaged by Debian (9.7\-3) |
| 157 |
.br |
| 158 |
Copyright \(co 2025 Free Software Foundation, Inc. |
| 159 |
.br |
| 160 |
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. |
| 161 |
.br |
| 162 |
This is free software: you are free to change and redistribute it. |
| 163 |
.br |
| 164 |
There is NO WARRANTY, to the extent permitted by law. |