code: 9ferno

ref: 58055b9e3a8c6df1cd128a3d4ed3667eab94e472
dir: /man/1/sort/

View raw version
.TH SORT 1
.SH NAME
sort \- sort file
.SH SYNOPSIS
.B sort
[
.B -nr
] [
.I file
]
.SH DESCRIPTION
.I Sort
sorts the lines of
.I file
(default: standard input)
and writes the sorted output to
standard output.
.PP
Whole lines are sorted into increasing order, using lexicographic ordering of Unicode characters
by default.
The sort is stable, so that lines that compare equal will appear in the output
in the same order as in the original file.
The sort order is affected by the following options:
.TP
.B -n
Each line is assumed to have an initial numeric string representing an integer,
with optional plus or minus sign, and the lines
are sorted by those numeric values into increasing order.
.TP
.B -r
Reverses the sense of comparisons.
.SH BUGS
The entire file is read into memory to be sorted.