hash(1) on Solnix vs Linux and the BSDs

On Solnix, hash is the illumos /usr/bin/hash utility, and the page also covers the sh, csh and ksh built-ins of the same names. The FreeBSD page named hash(1) is only an index of shell built-ins (builtin(1)), so it documents no hash options.

What Solnix runs

A default Solnix system runs the illumos /usr/bin/hash. /usr/xpg4/bin/hash is also shipped, but the bundle does not describe how it differs. The Solnix page covers /usr/bin/hash plus the sh, csh and ksh built-ins hash, rehash, unhash and hashstat.

Differences

Compared withTopicWhat differs
FreeBSDwhat the hash(1) page documentsThe FreeBSD hash(1) page is the builtin(1) index of csh and sh built-ins, titled 'builtin, keybinds'. It has no hash synopsis, options or exit status. The Solnix page documents hash, its -r option and its exit status.
Source: FreeBSD hash(1) NAME, SYNOPSIS, DESCRIPTION; Solnix hash(1) SYNOPSIS, DESCRIPTION
FreeBSDhash as a standalone utilitySolnix ships /usr/bin/hash as an executable. The FreeBSD table marks hash as 'No*': an external file exists but is implemented as a script around the shell built-in. The table shows hash as built into sh(1) only, not csh(1).
Source: FreeBSD hash(1) Commands table (hash: No*, csh No, sh Yes); Solnix hash(1) SYNOPSIS (/usr/bin/hash)
FreeBSDcsh hash commandsThe Solnix page documents csh rehash, unhash and hashstat. The FreeBSD table lists rehash, unhash and hashstat as csh built-ins with no standalone utility. Their behaviour is not described in the FreeBSD page.
Source: Solnix hash(1) csh; FreeBSD hash(1) Commands table (hashstat, rehash, unhash)
FreeBSDksh built-inThe Solnix page documents a ksh hash built-in. The FreeBSD page lists only csh(1) and sh(1) as its shells and does not mention ksh.
Source: Solnix hash(1) ksh; FreeBSD hash(1) DESCRIPTION and Commands table
FreeBSD-r and the sh hash outputOn Solnix, hash -r makes the shell forget all remembered locations. With no arguments, the sh built-in prints a Hits and Cost listing, and an asterisk marks relative-directory entries. The FreeBSD page does not describe -r or any output format.
Source: Solnix hash(1) DESCRIPTION (sh, /usr/bin/hash); FreeBSD hash(1) has no hash option text
FreeBSDexit status and environmentSolnix /usr/bin/hash returns 0 on success and >0 on error, and uses PATH to locate the utility. The FreeBSD page states no exit status or environment variables for hash.
Source: Solnix hash(1) EXIT STATUS, ENVIRONMENT VARIABLES; FreeBSD hash(1) (no such sections for hash)
Linux, OpenBSD, NetBSDno counterpart page in the bundleNo Linux, OpenBSD or NetBSD page is supplied for hash. The bundle supports no claim about how hash behaves on those systems.
Source: Bundle header (only a FreeBSD counterpart is listed)

Standards

  • POSIX: hash is a POSIX.1-2024 utility.
  • Solnix: Interface Stability: Standard. The page also refers to standards(7).
  • FreeBSD: The FreeBSD page shown (builtin index) states no standards conformance for hash.

Writing portable scripts

  • Use only 'hash' and 'hash -r' in portable scripts. These are the forms in the POSIX synopsis for /usr/bin/hash and the sh built-in on Solnix; the bundle does not document hash on the other systems.
  • Do not rely on csh rehash, unhash or hashstat in scripts. The Solnix and FreeBSD pages list them as csh-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.