head(1) on Solnix vs Linux and the BSDs
On Solnix, head is the illumos /usr/bin/head, which accepts -n, -c, -q, -v and the historic -number. The main difference for Linux and BSD users is that the illumos page documents no negative counts (all but the last NUM) and no size suffixes for /usr/bin/head. It also gives -v and -q their own meaning only as in the BSDs and GNU, and OpenBSD has neither.
The manual pages
- Solnix: head(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: head(1) coreutils-full-9.11
- FreeBSD: head(1) 15.1-RELEASE
- OpenBSD: head(1) 8.0
- NetBSD: head(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
head
What Solnix runs
A default Solnix system runs the illumos /usr/bin/head. When head is run without a path prefix, the ksh93 built-in may be used instead; the page says it is bound to /bin and /usr/bin. The built-in adds -s skip, long options (--lines, --bytes, --quiet|silent, --skip, --verbose) and b, k, m unit suffixes for -c and -s. /usr/ucb/head is also shipped, but the bundle does not describe it.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | negative counts | Linux head -n -NUM and -c -NUM print all but the last NUM lines or bytes. The Solnix /usr/bin/head page says the number must be a positive decimal integer and documents no negative form.Source: Linux head(1) -c, -n; Solnix head(1) OPTIONS /usr/bin/head -n, -c |
| Linux, FreeBSD | size suffixes and long options | Linux and FreeBSD accept suffixes on counts and long options such as --lines and --bytes. The Solnix /usr/bin/head page documents neither. Only the ksh93 built-in has long options and b, k, m suffixes for -c and -s.Source: Linux head(1) NUM multiplier suffix; FreeBSD head(1) -c, -n (expand_number(3)); Solnix head(1) OPTIONS ksh93 |
| all four | -s skip option | Solnix has -s skip only in the ksh93 built-in, which skips characters or lines before copying. No counterpart page documents -s.Source: Solnix head(1) OPTIONS ksh93 -s, --skip; Linux/FreeBSD/OpenBSD/NetBSD head(1) SYNOPSIS |
| OpenBSD | -c, -q, -v missing | OpenBSD head documents only -n count and -count. A script using -c, -q or -v works on Solnix, Linux, FreeBSD and NetBSD, but the OpenBSD page documents no such option.Source: OpenBSD head(1) SYNOPSIS; Solnix head(1) OPTIONS -c, -q, -v |
| OpenBSD | header for several files | OpenBSD head prints the ==> file <== header when more than one file is given. The page documents no way to suppress it or to force it for a single file. Solnix has -q and -v for that.Source: OpenBSD head(1) DESCRIPTION; Solnix head(1) OPTIONS -q, -v |
| Linux | -z and --silent | Linux head has -z to use NUL as the line delimiter. The Solnix /usr/bin/head page has no -z. The ksh93 built-in takes --quiet|silent, as Linux does.Source: Linux head(1) -z, --zero-terminated; Solnix head(1) OPTIONS |
| all four | -number syntax | Solnix documents -number as equal to -n number, so head -5 works. Linux and FreeBSD do not list it in the options. OpenBSD and NetBSD document the historic syntax.Source: Solnix head(1) OPTIONS -number; OpenBSD head(1) STANDARDS; NetBSD head(1) COMPATIBILITY; Linux head(1) OPTIONS; FreeBSD head(1) SYNOPSIS |
| all four | multibyte output with -c | Solnix warns that head -c may end output in the middle of a multi-byte character. The counterpart pages do not mention this.Source: Solnix head(1) OPTIONS -c; Linux/FreeBSD/OpenBSD/NetBSD head(1) |
| FreeBSD, NetBSD | -c and -n together | The FreeBSD synopsis shows -n count and -c bytes as alternatives. The NetBSD page says -c makes head count bytes instead of lines. The Solnix synopsis lists both options together, and the page does not say what happens if both are given.Source: FreeBSD head(1) SYNOPSIS; NetBSD head(1) DESCRIPTION; Solnix head(1) SYNOPSIS |
Standards
- POSIX: head is a POSIX.1-2024 utility.
- Solnix:
/usr/bin/head: Interface Stability Committed; Standard: see standards(7). The ksh93 built-in binding to/binand/usr/binis Volatile and the built-in interfaces are Uncommitted. - OpenBSD: head is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification; the historic
-countsyntax is supported. - NetBSD: head conforms to IEEE Std 1003.2-1992 (“POSIX.2”).
- Linux: The manual has no standards section in the bundle.
- FreeBSD: The manual has no standards section in the bundle.
Writing portable scripts
- Use only head
-nN with a positive N, plus-cN for bytes where needed. Do not rely on negative counts, size suffixes or long options. - Avoid
-qand-vif OpenBSD must be supported. Do not use head-zor-s.
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.