wc(1) on Solnix vs Linux and the BSDs
On a default Solnix system wc is the illumos /usr/bin/wc, which has only -c, -m, -C, -l and -w. It has no -L, --total or --files0-from. -L and -q exist only in the ksh93 built-in, which the page says is used when wc is run without a path prefix.
The manual pages
- Solnix: wc(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: wc(1) coreutils-full-9.11
- FreeBSD: wc(1) 15.1-RELEASE
- OpenBSD: wc(1) 8.0
- NetBSD: wc(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
wc
What Solnix runs
A default Solnix system runs the illumos wc at /usr/bin/wc. The Solnix page documents two forms. /usr/bin/wc has the synopsis [-c | -m | -C] [-lw]. The ksh93 built-in has [-c | -m | -C] [-lLqw] and long options (--bytes, --lines, --longest-line, --multibyte-chars, --quiet, --words). The page says the built-in is used when wc is run without a pathname prefix and the search finds /bin/wc or /usr/bin/wc. /usr/ucb/wc is also shipped, but the bundle does not describe it.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | -L missing from /usr/bin/wc | The Solnix /usr/bin/wc synopsis has no -L. Only the ksh93 built-in accepts -L (longest line length). Linux -L prints the maximum display width. A script that uses wc -L may fail where the external command is run.Source: Solnix wc(1) SYNOPSIS (/usr/bin/wc vs ksh93), -L; Linux wc(1) -L, --max-line-length |
| FreeBSD, NetBSD | -L meaning | FreeBSD -L reports the longest line in bytes, or in characters with -m. NetBSD -L reports the longest line in characters. Both pages call -L a non-standard extension. Solnix -L is available only in the ksh93 built-in, and the page says only 'longest line length'.Source: FreeBSD wc(1) -L, COMPATIBILITY; NetBSD wc(1) -L, COMPATIBILITY; Solnix wc(1) ksh93 -L |
| Linux | no --files0-from, --total, --debug | Linux wc has --files0-from=F (NUL-separated names), --total=WHEN (auto, always, only, never) and --debug. The Solnix page documents none of these. A Linux script using them will fail on Solnix.Source: Linux wc(1) --files0-from, --total, --debug; Solnix wc(1) SYNOPSIS and OPTIONS |
| all four | -C | Solnix accepts -C as a synonym for -m. The Linux, FreeBSD, OpenBSD and NetBSD synopses and option lists do not have -C.Source: Solnix wc(1) OPTIONS -C; Linux/FreeBSD/OpenBSD/NetBSD wc(1) SYNOPSIS |
| all four | -q and warnings | The Solnix ksh93 built-in has -q (--quiet) to suppress invalid multibyte character warnings. None of the four counterpart pages has -q.Source: Solnix wc(1) ksh93 -q, --quiet; counterpart wc(1) SYNOPSIS |
| OpenBSD | -h human-readable | OpenBSD -h prints counts with unit suffixes (K, M, G ...), and its page marks it as an extension. Solnix has no -h, so the flag fails there.Source: OpenBSD wc(1) -h, STANDARDS; Solnix wc(1) SYNOPSIS |
| FreeBSD | -c and -m interaction | On FreeBSD, -c cancels an earlier -m and -m cancels an earlier -c. The Solnix ksh93 text says -c, -C and -m are mutually exclusive. The /usr/bin/wc text does not say what happens when they are combined.Source: FreeBSD wc(1) -c, -m; Solnix wc(1) ksh93 DESCRIPTION |
| FreeBSD, OpenBSD | -m in a non-multibyte locale | FreeBSD -m equals -c if the locale lacks multibyte support. OpenBSD -m equals -c if LC_CTYPE is unset or is C, POSIX or unsupported. The Solnix page does not state this fallback. It says -m counts characters.Source: FreeBSD wc(1) -m; OpenBSD wc(1) ENVIRONMENT LC_CTYPE; Solnix wc(1) OPTIONS -m |
| Linux, FreeBSD | column order of output | Linux prints counts in the fixed order newline, word, character, byte, max line length. FreeBSD prints line, word, byte, then file name. The Solnix page says the default is lines, words and bytes (-lwc) and does not state the order for combined options.Source: Linux wc(1) DESCRIPTION; FreeBSD wc(1) DESCRIPTION; Solnix wc(1) OPTIONS |
| FreeBSD | libxo output and SIGINFO | FreeBSD wc has --libxo for machine-readable output and prints interim counts to stderr on SIGINFO. The Solnix page documents neither.Source: FreeBSD wc(1) --libxo, SIGINFO paragraph; Solnix wc(1) |
| Linux, FreeBSD, OpenBSD | environment variables | Solnix lists LANG, LC_ALL, LC_CTYPE, LC_MESSAGES and NLSPATH. FreeBSD lists LANG, LC_ALL and LC_CTYPE. OpenBSD lists only LC_CTYPE. The Linux page lists none. Source: Solnix wc(1) ENVIRONMENT VARIABLES; FreeBSD wc(1) ENVIRONMENT; OpenBSD wc(1) ENVIRONMENT; Linux wc(1) |
| FreeBSD, OpenBSD, NetBSD | reading standard input with - | The Linux page and the Solnix ksh93 text say a file operand of - means standard input. The Solnix /usr/bin/wc, FreeBSD, OpenBSD and NetBSD pages only say standard input is used when no file is given.Source: Linux wc(1) DESCRIPTION; Solnix wc(1) ksh93 DESCRIPTION; FreeBSD/OpenBSD/NetBSD wc(1) DESCRIPTION |
Standards
- POSIX: wc is a POSIX.1-2024 utility.
- Solnix:
/usr/bin/wc: Interface Stability Committed; Standard 'See standards(7)'. The ksh93 built-in binding to/binand/usr/binis Volatile, and the built-in interfaces are Uncommitted. - FreeBSD: The wc utility conforms to IEEE Std 1003.1-2001 (“POSIX.1”).
-Lis a non-standard FreeBSD extension compatible with GNU wc. - OpenBSD: The wc utility is compliant with the specification. The flag
-his an extension to that specification. - NetBSD: The wc utility conforms to IEEE Std 1003.2-1992 (“POSIX.2”).
-Lis a non-standard extension.
Writing portable scripts
- Use only
-c,-l,-mand-win portable scripts.-L,-C,-q,-h,--totaland--files0-fromare missing or differ between systems. - To get a bare number, feed wc from stdin (wc
-l< file) and avoid parsing the filename column. Do not depend on a fixed column width or order beyond lines, words, bytes.
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.