sort(1) on Solnix vs Linux and the BSDs
On Solnix, sort is the illumos sort at /usr/bin/sort. The SYNOPSIS lists no GNU-style long options and no -g, -h, -R, -V or -C. The flags -z and -y are obsolete no-ops there, while -z means NUL-terminated lines on Linux, FreeBSD and OpenBSD.
The manual pages
- Solnix: sort(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: sort(1) coreutils-full-9.11
- FreeBSD: sort(1) 15.1-RELEASE
- OpenBSD: sort(1) 8.0
- NetBSD: sort(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
sort
What Solnix runs
/usr/bin/sort is the illumos sort, and /usr/xpg4/bin/sort is also shipped with the same synopsis. The one documented difference is -c. With /usr/bin/sort it sets the exit code and prints nothing unless the file is out of order. With /usr/xpg4/bin/sort it prints no output under any circumstances.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, FreeBSD, OpenBSD | -z meaning | Solnix -z recsz is obsolete and takes an argument. The manual says it has no effect. On Linux, FreeBSD and OpenBSD, -z makes NUL the line delimiter and takes no argument. A script using sort -z for NUL-separated data will not work on Solnix.Source: Solnix sort(1) SYNOPSIS and -z recsz; Linux sort(1) -z, --zero-terminated; FreeBSD sort(1) DESCRIPTION (-z); OpenBSD sort(1) DESCRIPTION (-z) |
| NetBSD | record separator | NetBSD changes the record separator with -R char. Solnix -R is not in its SYNOPSIS, and Solnix -z is an obsolete no-op, so there is no documented way to change the separator.Source: NetBSD sort(1) -R char; Solnix sort(1) SYNOPSIS, -z recsz |
| Linux, FreeBSD, OpenBSD | missing ordering options | The Solnix SYNOPSIS and OPTIONS list no -g (general numeric), -h (human-readable numbers), -R (random) or -V (version sort), and no --sort=WORD. Linux, FreeBSD and OpenBSD document all of these.Source: Solnix sort(1) SYNOPSIS, Ordering Options; Linux sort(1) -g, -h, -R, -V; FreeBSD sort(1) -g, -h, -R, -V; OpenBSD sort(1) -g, -h, -R, -V |
| all four | -C silent check | Solnix has no -C. Its /usr/bin sort -c is already quiet unless the file is out of order, and /usr/xpg4/bin/sort -c is always quiet. Linux, FreeBSD, OpenBSD and NetBSD -C is a silent check, and their -c prints an error message when the input is unsorted.Source: Solnix sort(1) OPTIONS -c; Linux sort(1) -C; FreeBSD sort(1) -c, -C; OpenBSD sort(1) -C, -c; NetBSD sort(1) -C, -c |
| all four | long options | Solnix sort documents only single-letter options. Linux, FreeBSD and OpenBSD document long forms such as --key, --output, --reverse and --unique. NetBSD's SYNOPSIS and OPTIONS list none. Linux also has --files0-from, --parallel and --debug.Source: Solnix sort(1) SYNOPSIS; Linux sort(1) options list; FreeBSD sort(1) options; OpenBSD sort(1) options; NetBSD sort(1) SYNOPSIS |
| NetBSD | -S meaning and stability | Solnix -S kmem sets the maximum memory used for sorting. On NetBSD, -S takes no argument and means 'don't use stable sort', and stable sorting is the default. NetBSD has no memory-size option in its SYNOPSIS.Source: Solnix sort(1) -S kmem; NetBSD sort(1) SYNOPSIS, -S, -s |
| Linux, FreeBSD, OpenBSD | -S size units and stable sort | Solnix -S counts kilobytes by default and accepts b, k, m, g, t and %. Linux counts K by default. The FreeBSD and OpenBSD pages do not state a default unit. Solnix has no -s in its SYNOPSIS. Equal keys are ordered by comparing all bytes, unless -u is given.Source: Solnix sort(1) -S kmem, -k keydef; Linux sort(1) SIZE, -s; FreeBSD sort(1) -S, -s; OpenBSD sort(1) -S, -s |
| all four | obsolete +pos1 -pos2 keys | The Solnix SYNOPSIS still shows [+pos1 [-pos2]], and so does NetBSD's text, which says +pos1/-pos2 are still supported. The Linux, FreeBSD and OpenBSD SYNOPSES show only -k. Use -k for portable scripts.Source: Solnix sort(1) SYNOPSIS; NetBSD sort(1) -k and +pos1 text; Linux/FreeBSD/OpenBSD sort(1) SYNOPSIS |
| all four | temporary directory default | The visible Solnix -T text names no default directory. Linux uses $TMPDIR or /tmp, FreeBSD uses TMPDIR or /var/tmp, and OpenBSD and NetBSD use TMPDIR or /tmp. Linux allows several -T options for several directories.Source: Solnix sort(1) -T directory; Linux sort(1) -T; FreeBSD sort(1) -T; OpenBSD sort(1) -T; NetBSD sort(1) -T |
| Linux, FreeBSD, OpenBSD | default collation | Solnix orders by the current locale's collating sequence, controlled by LC_COLLATE. C gives ASCII order, and en_US sorts case-insensitively except on ties. OpenBSD says the default is ascii(7) order. The Linux page warns that the locale affects order and says to set LC_ALL=C for byte order. Source: Solnix sort(1) Ordering Options; OpenBSD sort(1) DESCRIPTION; Linux sort(1) WARNING |
| NetBSD | -l and -n details | NetBSD -l sorts by field length, which Solnix does not document. NetBSD -n accepts an optional plus or minus sign, while the Solnix -n text mentions only an optional minus sign and locale thousands separators.Source: NetBSD sort(1) -l, -n; Solnix sort(1) -n |
| all four | -y memory option | Solnix still lists -y [kmem] as an obsolete memory option, replaced by -S. None of the Linux, FreeBSD, OpenBSD or NetBSD pages document -y.Source: Solnix sort(1) SYNOPSIS, -y kmem; Linux/FreeBSD/OpenBSD/NetBSD sort(1) options |
Standards
- POSIX: sort is a POSIX.1-2024 utility.
- FreeBSD:
-s(stable sort) is described as a non-standard feature that is widely accepted and used. - OpenBSD:
-s(stable sort) is described as a non-standard feature that is widely accepted and used.
Writing portable scripts
- Stick to
-b-d-f-i-M-n-r-u-c-m-o-k-t. Avoid-z,-s,-S,-g,-h,-Vand-R, which differ or are missing on Solnix. - Set LC_ALL=C before sorting when the order must be the same on every system, because collation depends on the locale and OpenBSD defaults to ascii(7) order.
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.