realpath(1) on Solnix vs Linux and the BSDs
realpath is not in the Solnix base system: install pkgs.solnix.coreutils to get the GNU coreutils realpath, whose page is dated 9.7. It matches Linux's GNU realpath apart from the -E/--canonicalize option, which the Solnix page does not list. The BSD realpath utilities take far fewer options (FreeBSD and OpenBSD only -q, NetBSD -e, -E and -q).
The manual pages
- Solnix: realpath(1) from
pkgs.solnix.coreutils - Linux: realpath(1) coreutils-full-9.11
- FreeBSD: realpath(1) 15.1-RELEASE
- OpenBSD: realpath(1) 8.0
- NetBSD: realpath(1) 11.0
- Standard: POSIX.1-2024 (IEEE Std 1003.1-2024),
realpath
What Solnix runs
Not installed by default: add pkgs.solnix.coreutils. The Solnix page is GNU coreutils 9.7 (April 2025). The bundle shows no other illumos variant of realpath.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | same program | The Solnix page and the Linux page describe the same GNU coreutils realpath, with the same synopsis and the same options except -E/--canonicalize. The Solnix page is 9.7 and the Linux page is 9.11.Source: Solnix realpath(1) SYNOPSIS, DESCRIPTION; Linux realpath(1) SYNOPSIS, DESCRIPTION |
| Linux | -E / --canonicalize | The Linux page lists -E, --canonicalize ('all but the last component must exist (default)'). The Solnix page has no -E entry, though its intro line states the same default. Do not use -E in scripts that must run on Solnix.Source: Linux realpath(1) -E, --canonicalize; Solnix realpath(1) DESCRIPTION |
| FreeBSD, OpenBSD | missing options | FreeBSD and OpenBSD realpath accept only -q. They have no -e, -m, -s, -L, -P, -z, --relative-to or --relative-base, all of which Solnix documents.Source: FreeBSD realpath(1) SYNOPSIS; OpenBSD realpath(1) SYNOPSIS; Solnix realpath(1) DESCRIPTION |
| NetBSD | NetBSD option set | NetBSD realpath has -e, -E and -q only. Solnix has -e, but not -E on its page, and adds -m, -s, -L, -P, -z, --relative-to and --relative-base, which NetBSD lacks.Source: NetBSD realpath(1) SYNOPSIS; Solnix realpath(1) DESCRIPTION |
| FreeBSD, NetBSD | no argument | With no path, FreeBSD and NetBSD resolve the current directory. The Solnix synopsis is realpath [OPTION]... FILE... with a required FILE, and the page does not describe the no-argument case. Source: FreeBSD realpath(1) DESCRIPTION; NetBSD realpath(1) DESCRIPTION; Solnix realpath(1) SYNOPSIS |
| OpenBSD | single argument | OpenBSD realpath takes one file argument (realpath [-q] file). Solnix, FreeBSD and NetBSD synopses accept several paths.Source: OpenBSD realpath(1) SYNOPSIS; Solnix realpath(1) SYNOPSIS; FreeBSD realpath(1) SYNOPSIS; NetBSD realpath(1) SYNOPSIS |
| FreeBSD, OpenBSD, NetBSD | -q scope | Solnix -q suppresses 'most error messages'. FreeBSD and NetBSD -q suppresses only warnings when realpath(3) fails. NetBSD says bad-usage messages are still printed. OpenBSD says 'Do not print errors'.Source: Solnix realpath(1) -q; FreeBSD realpath(1) DESCRIPTION; NetBSD realpath(1) DESCRIPTION; OpenBSD realpath(1) -q |
| NetBSD | -e semantics and default | NetBSD -E is the default, so a missing final component is not an error. NetBSD -e requires the whole path to exist. Solnix -e also requires all components to exist, and the Solnix default likewise lets the last one be missing.Source: NetBSD realpath(1) DESCRIPTION (-E, -e); Solnix realpath(1) -e and intro line |
| FreeBSD, OpenBSD, NetBSD | output terminator | Solnix -z ends each output line with NUL instead of newline. The BSD pages document no such option. NetBSD says each result is followed by a newline.Source: Solnix realpath(1) -z; NetBSD realpath(1) DESCRIPTION; FreeBSD realpath(1) SYNOPSIS; OpenBSD realpath(1) SYNOPSIS |
| FreeBSD, OpenBSD, NetBSD | exit status documentation | The three BSD pages state exit 0 on success and >0 on error. NetBSD adds that any failure to resolve a path is an error, even with -q. The Solnix page has no exit-status section.Source: FreeBSD, OpenBSD, NetBSD realpath(1) EXIT STATUS; Solnix realpath(1) (no EXIT STATUS section) |
Standards
- POSIX: realpath is a POSIX.1-2024 utility.
- NetBSD: The realpath utility is expected to comply with the forthcoming edition of the POSIX standard. To be fully compliant, applications must use
-eor-E, and the standard requires support for only a single, mandatory, path argument. - Solnix: The Solnix page has no STANDARDS section.
Writing portable scripts
- Pass exactly one path argument and avoid options other than
-eor-q;-eis missing on FreeBSD and OpenBSD, so test for it. - Do not rely on the no-argument form: write realpath . when you mean the current directory.
- Check the exit status, not the
-qoutput, to detect failure.
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.