pathchk(1) on Solnix vs Linux and the BSDs
On Solnix, pathchk is the illumos pathchk at /usr/bin/pathchk. It accepts only -p. Linux (GNU coreutils) and FreeBSD add -P for empty names and leading hyphens, and Linux also adds --portability.
The manual pages
- Solnix: pathchk(1) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: pathchk(1) coreutils-full-9.11
- FreeBSD: pathchk(1) 15.1-RELEASE
- NetBSD: pathchk(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
pathchk
What Solnix runs
A default Solnix system runs the illumos pathchk at /usr/bin/pathchk. No other variants are shipped. The Solnix page lists only the -p option.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, FreeBSD | -P option | Linux and FreeBSD pathchk accept -P, which also flags empty path names and components that start with a hyphen. The Solnix synopsis is pathchk [-p] path... and has no -P, so a script using -P is not documented to work on Solnix.Source: Linux pathchk(1) -P; FreeBSD pathchk(1) SYNOPSIS and -P; Solnix pathchk(1) SYNOPSIS, OPTIONS |
| Linux | --portability, --help, --version | GNU pathchk has --portability (equivalent to -p -P), --help and --version. The Solnix page documents no long options.Source: Linux pathchk(1) --portability, --help, --version; Solnix pathchk(1) OPTIONS |
| Linux, FreeBSD, NetBSD | leading hyphen under -p | FreeBSD and NetBSD say that under -p no component may start with a hyphen. The Solnix -p text lists only length limits and the portable filename character set, and the manual does not say whether a leading hyphen is flagged.Source: FreeBSD pathchk(1) -p; NetBSD pathchk(1) -p; Solnix pathchk(1) -p |
| FreeBSD, NetBSD | stated -p limits | FreeBSD and NetBSD give _POSIX_PATH_MAX as 255 bytes and _POSIX_NAME_MAX as 14 bytes. The Solnix page names the constants without giving values. Source: FreeBSD pathchk(1) -p; NetBSD pathchk(1) -p; Solnix pathchk(1) -p |
| Linux, FreeBSD, NetBSD | invalid characters in default check | The Solnix default check also reports any character in a component that is not valid in its containing directory. The FreeBSD and NetBSD default lists have no such item, and the Linux page does not describe its default checks. Source: Solnix pathchk(1) DESCRIPTION; FreeBSD pathchk(1) DESCRIPTION; NetBSD pathchk(1) DESCRIPTION; Linux pathchk(1) DESCRIPTION |
| Linux, FreeBSD, NetBSD | locale and environment variables | The Solnix page lists LANG, LC_ALL, LC_CTYPE, LC_MESSAGES and NLSPATH as affecting pathchk, and refers to largefile(7) for files of 2 Gbyte or more. The Linux, FreeBSD and NetBSD pages document no environment variables. Source: Solnix pathchk(1) ENVIRONMENT VARIABLES, USAGE; Linux, FreeBSD and NetBSD pathchk(1) |
| Linux, NetBSD | exit status | Solnix and FreeBSD document exit 0 for success and >0 for an error. The Linux and NetBSD pages have no exit status section. Source: Solnix pathchk(1) EXIT STATUS; FreeBSD pathchk(1) EXIT STATUS; Linux pathchk(1); NetBSD pathchk(1) |
Standards
- POSIX: pathchk is a POSIX.1-2024 utility.
- Solnix: Interface Stability: Standard.
- FreeBSD: The pathchk utility conforms to IEEE Std 1003.1-2001 (“POSIX.1”).
- NetBSD: The pathchk utility conforms to IEEE Std 1003.1-2001 (“POSIX.1”).
Writing portable scripts
- Use only pathchk
-ppath... in portable scripts.-Pand--portabilityare missing from the Solnix and NetBSD pages. - If you need to catch empty names or leading hyphens on every system, test for them in the shell, because
-Pis not available everywhere.
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.