aboutsummaryrefslogtreecommitdiff
path: root/man/sort.1
diff options
context:
space:
mode:
authorSoccera1 <[email protected]>2026-07-28 15:54:54 +1000
committerSoccera1 <[email protected]>2026-07-28 15:54:54 +1000
commit6a2f098e72e71437154ec00506e8e736aa8e1026 (patch)
tree63e9f5596be38558dbeb40bb566735759a3ccabb /man/sort.1
parenta753f669c9bedfccb9f7f400da018bb487dca5d0 (diff)
downloadbnu-6a2f098e72e71437154ec00506e8e736aa8e1026.tar.gz
bnu-6a2f098e72e71437154ec00506e8e736aa8e1026.zip
Add docs
Diffstat (limited to 'man/sort.1')
-rw-r--r--man/sort.1163
1 files changed, 163 insertions, 0 deletions
diff --git a/man/sort.1 b/man/sort.1
new file mode 100644
index 0000000..b4b5d02
--- /dev/null
+++ b/man/sort.1
@@ -0,0 +1,163 @@
+.\" Adapted for BNU from the GNU Coreutils 9.11 manual page; see doc/README.md.
+.TH SORT "1" "2026-07-28" "BNU 9.11" "BNU Commands"
+.SH NAME
+sort \- sort lines of text files
+.SH SYNOPSIS
+.B sort
+[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]...
+.br
+.B sort
+[\fI\,OPTION\/\fR]... \fI\,--files0-from=F\/\fR
+.SH DESCRIPTION
+.\" This page is derived from GNU Coreutils documentation.
+This page documents BNU, an independent Bun implementation compatible with
+GNU Coreutils 9.11.
+.PP
+Write sorted concatenation of all FILE(s) to standard output.
+.PP
+With no FILE, or when FILE is \-, read standard input.
+.PP
+Mandatory arguments to long options are mandatory for short options too.
+Ordering options:
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-b'\fB\-b, \-\-ignore\-leading\-blanks\fP\X'tty: link'
+ignore leading blanks when finding sort keys in each line
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-d'\fB\-d, \-\-dictionary\-order\fP\X'tty: link'
+consider only blanks and alphanumeric characters
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-f'\fB\-f, \-\-ignore\-case\fP\X'tty: link'
+fold lower case to upper case characters
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-g'\fB\-g, \-\-general\-numeric\-sort\fP\X'tty: link'
+compare according to general numerical value
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-i'\fB\-i, \-\-ignore\-nonprinting\fP\X'tty: link'
+consider only printable characters
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-M'\fB\-M, \-\-month\-sort\fP\X'tty: link'
+compare (unknown) < 'JAN' < ... < 'DEC'
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-h'\fB\-h, \-\-human\-numeric\-sort\fP\X'tty: link'
+compare human readable numbers (e.g., 2K 1G)
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-n'\fB\-n, \-\-numeric\-sort\fP\X'tty: link'
+compare according to string numerical value;
+see full documentation for supported strings
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-R'\fB\-R, \-\-random\-sort\fP\X'tty: link'
+shuffle, but group identical keys. See also \fBshuf\fP(1)
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort--random-source'\fB\-\-random\-source=FILE\fP\X'tty: link'
+get random bytes from FILE
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-r'\fB\-r, \-\-reverse\fP\X'tty: link'
+reverse the result of comparisons
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort--sort'\fB\-\-sort=WORD\fP\X'tty: link'
+sort according to WORD:
+general\-numeric \fB\-g\fR, human\-numeric \fB\-h\fR, month \fB\-M\fR,
+numeric \fB\-n\fR, random \fB\-R\fR, version \fB\-V\fR
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-V'\fB\-V, \-\-version\-sort\fP\X'tty: link'
+natural sort of (version) numbers within text
+.PP
+Other options:
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort--batch-size'\fB\-\-batch\-size=NMERGE\fP\X'tty: link'
+merge at most NMERGE inputs at once; for more use temp files
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-c'\fB\-c, \-\-check, \-\-check=\,diagnose\-first\fP\X'tty: link'\/\fR
+check for sorted input; do not sort
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-C'\fB\-C, \-\-check=\,quiet\/, \-\-check=\,silent\fP\X'tty: link'\/\fR
+like \fB\-c\fR, but do not report first bad line
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort--compress-program'\fB\-\-compress\-program=PROG\fP\X'tty: link'
+compress temporaries with PROG; decompress them with PROG \fB\-d\fR
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort--debug'\fB\-\-debug\fP\X'tty: link'
+annotate the part of the line used to sort,
+and warn about questionable usage to standard error
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort--files0-from'\fB\-\-files0\-from=F\fP\X'tty: link'
+read input from the files specified by NUL\-terminated names in file F;
+If F is \-, read names from standard input
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-k'\fB\-k, \-\-key=\,KEYDEF\fP\X'tty: link'\/\fR
+sort via a key; KEYDEF gives location and type
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-m'\fB\-m, \-\-merge\fP\X'tty: link'
+merge already sorted files; do not sort
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-o'\fB\-o, \-\-output=\,FILE\fP\X'tty: link'\/\fR
+write result to FILE instead of standard output
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-s'\fB\-s, \-\-stable\fP\X'tty: link'
+stabilize sort by disabling last\-resort comparison
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-S'\fB\-S, \-\-buffer\-size=\,SIZE\fP\X'tty: link'\/\fR
+use SIZE for main memory buffer
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-t'\fB\-t, \-\-field\-separator=\,SEP\fP\X'tty: link'\/\fR
+use SEP instead of non\-blank to blank transition
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-T'\fB\-T, \-\-temporary\-directory=\,DIR\fP\X'tty: link'\/\fR
+use DIR for temporaries, not $TMPDIR or \fI\,/tmp\/\fP;
+multiple options specify multiple directories
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort--parallel'\fB\-\-parallel=N\fP\X'tty: link'
+change the number of sorts run concurrently to N
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-u'\fB\-u, \-\-unique\fP\X'tty: link'
+output only the first of lines with equal keys;
+with \fB\-c\fR, check for strict ordering
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/manual/coreutils.html#sort-z'\fB\-z, \-\-zero\-terminated\fP\X'tty: link'
+line delimiter is NUL, not newline
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/sort#sort--help'\fB\-\-help\fP\X'tty: link'
+display this help and exit
+.TP
+\X'tty: link https://www.gnu.org/software/coreutils/sort#sort--version'\fB\-\-version\fP\X'tty: link'
+output version information and exit
+.PP
+KEYDEF is F[.C][OPTS][,F[.C][OPTS]] for start and stop position, where F is a
+field number and C a character position in the field; both are origin 1, and
+the stop position defaults to the line's end. If neither \fB\-t\fR nor \fB\-b\fR is in
+effect, characters in a field are counted from the beginning of the preceding
+whitespace. OPTS is one or more single\-letter ordering options [bdfgiMhnRrV],
+which override global ordering options for that key. If no key is given, use
+the entire line as the key. Use \fB\-\-debug\fR to diagnose incorrect key usage.
+.PP
+SIZE may be followed by the following multiplicative suffixes:
+% 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y, R, Q.
+.PP
+*** WARNING ***
+The locale specified by the environment affects sort order.
+Set LC_ALL=C to get the traditional sort order that uses
+native byte values.
+.SH AUTHORS
+Upstream GNU Coreutils documentation authors:
+Written by Mike Haertel and Paul Eggert.
+.br
+Adapted for BNU; the BNU implementation is independent.
+.SH "REPORTING BUGS"
+Report BNU bugs at <https://github.com/Soccera1/bnu/issues>.
+.br
+For upstream GNU Coreutils, see <https://www.gnu.org/software/coreutils/>.
+.SH COPYRIGHT
+Copyright \(co 2026 Free Software Foundation, Inc.
+.br
+This manual page was adapted for BNU in 2026.
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
+.br
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+.SH "SEE ALSO"
+\fBshuf\fP(1), \fBuniq\fP(1)
+.PP
+.br
+Upstream documentation <https://www.gnu.org/software/coreutils/sort>
+.br
+BNU documentation is available locally via: info \(aq(bnu) sort invocation\(aq