SORT(1) General Commands Manual SORT(1)

# [NAME](#NAME)

sort - Display sorted concatenation of all FILE(s). With no FILE, or when FILE is -, read standard input.

# [SYNOPSIS](#SYNOPSIS)

**sort** \[OPTION]... \[FILE]...

# [DESCRIPTION](#DESCRIPTION)

Display sorted concatenation of all FILE(s). With no FILE, or when FILE is -, read standard input.

# [OPTIONS](#OPTIONS)

[**--help**](#help)

Print help information.

[**--version**](#version)

Print version information.

[**--sort**](#sort)

*Possible values:*

- general-numeric
- human-numeric
- month
- numeric
- version
- random

[**-h**, **--human-numeric-sort**](#h)

compare according to human readable sizes, eg 1M &gt; 100k

[**-M**, **--month-sort**](#M)

compare according to month name abbreviation

[**-n**, **--numeric-sort**](#n)

compare according to string numerical value

[**-g**, **--general-numeric-sort**](#g)

compare according to string general numerical value

[**-V**, **--version-sort**](#V)

Sort by SemVer version number, eg 1.12.2 &gt; 1.1.2

[**-R**, **--random-sort**](#R)

shuffle in random order

[**--random-source** *&lt;FILE&gt;*](#random)

use FILE as a source of random data

[**-d**, **--dictionary-order**](#d)

consider only blanks and alphanumeric characters

[**-m**, **--merge**](#m)

merge already sorted files; do not sort

[**-c**, **--check**](#c)

check for sorted input; do not sort

*Possible values:*

- silent
- quiet
- diagnose-first

[**-C**, **--check-silent**](#C)

exit successfully if the given file is already sorted, and exit with status 1 otherwise.

[**-f**, **--ignore-case**](#f)

fold lower case to upper case characters

[**-i**, **--ignore-nonprinting**](#i)

ignore nonprinting characters

[**-b**, **--ignore-leading-blanks**](#b)

ignore leading blanks when finding sort keys in each line

[**-o**, **--output** *&lt;FILENAME&gt;*](#o)

write output to FILENAME instead of stdout

[**-r**, **--reverse**](#r)

reverse the output

[**-s**, **--stable**](#s)

stabilize sort by disabling last-resort comparison

[**-u**, **--unique**](#u)

output only the first of an equal run

[**-k**, **--key**](#k)

sort by a key

[**-t**, **--field-separator**](#t)

custom separator for -k

[**-z**, **--zero-terminated**](#z)

line delimiter is NUL, not newline

[**--parallel** *&lt;NUM\_THREADS&gt;*](#parallel)

change the number of threads running concurrently to NUM\_THREADS

[**-S**, **--buffer-size** *&lt;SIZE&gt;*](#S)

sets the maximum SIZE of each segment in number of sorted items

[**-T**, **--temporary-directory** *&lt;DIR&gt;*](#T)

use DIR for temporaries, not $TMPDIR or /tmp

[**--compress-program** *&lt;PROG&gt;*](#compress)

compress temporary files with PROG, decompress with PROG -d; PROG has to take input from stdin and output to stdout

[**--batch-size** *&lt;N\_MERGE&gt;*](#batch)

Merge at most N\_MERGE inputs at once.

[**--files0-from** *&lt;NUL\_FILE&gt;*](#files0)

read input from the files specified by NUL-terminated NUL\_FILE

[**--debug**](#debug)

underline the parts of the line that are actually used for sorting

\[*files*]

# [EXTRA](#EXTRA)

The key format is FIELD\[.CHAR]\[OPTIONS]\[,FIELD\[.CHAR]]\[OPTIONS].

Fields by default are separated by the first whitespace after a non-whitespace character. Use -t to specify a custom separator. In the default case, whitespace is appended at the beginning of each field. Custom separators however are not included in fields.

FIELD and CHAR both start at 1 (i.e. they are 1-indexed). If there is no end specified after a comma, the end will be the end of the line. If CHAR is set 0, it means the end of the field. CHAR defaults to 1 for the start position and to 0 for the end position.

Valid options are: MbdfhnRrV. They override the global options for this key.

# [VERSION](#VERSION)

v(uutils coreutils) 0.12.0

2026-10-08

---

Document: sort(1) from uutils 0.12.0-r2 (Chainguard OS)
Source: https://github.com/uutils/coreutils
