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.

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 withTopicWhat differs
Linux, FreeBSD-P optionLinux 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, --versionGNU 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, NetBSDleading hyphen under -pFreeBSD 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, NetBSDstated -p limitsFreeBSD 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, NetBSDinvalid characters in default checkThe 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, NetBSDlocale and environment variablesThe 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, NetBSDexit statusSolnix 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 -p path... in portable scripts. -P and --portability are 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 -P is 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.