pwd(1) on Solnix vs Linux and the BSDs

On Solnix, pwd is the illumos /usr/bin/pwd, which defaults to -P like Linux, OpenBSD and NetBSD. FreeBSD defaults to -L. The page tells you to give -L or -P explicitly for portable use.

What Solnix runs

A default Solnix system runs the illumos pwd at /usr/bin/pwd. No other variants are shipped. The page says the Bourne shell, the Korn shells and most other shells have a built-in pwd, which runs instead of /usr/bin/pwd unless you give an absolute path.

Differences

Compared withTopicWhat differs
FreeBSDdefault modeWith no option, Solnix pwd acts as -P and prints the physical path. FreeBSD pwd assumes -L, so inside a symlinked directory the two print different results.
Source: Solnix pwd(1) DESCRIPTION (no options is -P); FreeBSD pwd(1) DESCRIPTION (-L assumed)
Linux, OpenBSD, NetBSDdefault modeThe default is -P on Solnix, Linux, OpenBSD and NetBSD, so the standalone commands agree when no option is given.
Source: Solnix pwd(1) DESCRIPTION; Linux pwd(1) DESCRIPTION; OpenBSD pwd(1) DESCRIPTION; NetBSD pwd(1) DESCRIPTION
Linuxsame options, GNU extrasLinux pwd takes -L and -P like Solnix, and also --logical, --physical, --help and --version. The Solnix page documents only -L and -P.
Source: Linux pwd(1) SYNOPSIS and options; Solnix pwd(1) SYNOPSIS
all fourshell builtinsThe Solnix page says sh, ksh, ksh93 and most other shells have a built-in pwd that runs unless you give an absolute path. Linux, FreeBSD, OpenBSD and NetBSD pages also warn that a shell builtin may differ, including in default.
Source: Solnix pwd(1) DESCRIPTION; Linux pwd(1) DESCRIPTION; FreeBSD pwd(1) DESCRIPTION; OpenBSD pwd(1) CAVEATS; NetBSD pwd(1) DESCRIPTION
OpenBSD-L fallback to -POpenBSD -L prints PWD only if it is absolute, names the current directory and has no . or .. components. Otherwise it acts as -P. The Solnix page lists similar criteria as examples only (it says 'Criteria may include').
Source: OpenBSD pwd(1) -L; Solnix pwd(1) -L
NetBSD-L validity checkNetBSD -L accepts PWD if it is absolute, contains neither /./ nor /../ and references the current directory. NetBSD notes that -L relies on unique inode numbers, so on FAT file systems it may miss a wrong PWD. The Solnix page does not mention this.
Source: NetBSD pwd(1) -L, BUGS; Solnix pwd(1) -L
FreeBSDPWD must be exportedFreeBSD documents that -L does not work unless the shell exports PWD. The Solnix page does not say this, though its -L relies on the PWD environment variable.
Source: FreeBSD pwd(1) BUGS; Solnix pwd(1) ENVIRONMENT VARIABLES
FreeBSD, OpenBSD, NetBSDoption overridingSolnix and OpenBSD say the last of -L and -P wins. The FreeBSD and NetBSD pages do not say how repeated or conflicting options combine.
Source: Solnix pwd(1) -L, -P; OpenBSD pwd(1) DESCRIPTION; FreeBSD pwd(1) options; NetBSD pwd(1) options
all fourerror behaviourOn error, Solnix writes nothing to standard output, writes a diagnostic to standard error and exits non-zero. The other pages say only that the exit status is >0 (Linux gives no exit status section).
Source: Solnix pwd(1) EXIT STATUS; FreeBSD pwd(1) EXIT STATUS; OpenBSD pwd(1) EXIT STATUS; NetBSD pwd(1) EXIT STATUS

Standards

  • POSIX: pwd is a POSIX.1-2024 utility.
  • Solnix: Interface Stability: Committed. The page says that for portable operation you should always specify -L or -P.
  • FreeBSD: The pwd utility conforms to IEEE Std 1003.1-2001 (“POSIX.1”).
  • OpenBSD: Compliant with IEEE Std 1003.1-2008 (“POSIX.1”), except that the standard says the default with no options should be -L.
  • NetBSD: Expected to conform to IEEE Std 1003.1 (“POSIX.1”), except that the default is -P not -L.

Writing portable scripts

  • Always pass -L or -P explicitly. The default is -P on Solnix, Linux, OpenBSD and NetBSD but -L on FreeBSD.
  • Use only -L and -P. --logical, --physical, --help and --version are in the Linux page only.

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.