whereis(1b) on Solnix vs Linux and the BSDs
On Solnix, whereis is the illumos BSD-compatibility command at /usr/ucb/whereis. It looks for binaries, manual pages and sources in a fixed built-in directory list. Linux and FreeBSD also use $PATH and $MANPATH, while OpenBSD and NetBSD search only binary directories and have almost no options.
The manual pages
- Solnix: whereis(1b) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: whereis(1) util-linux-2.42.3
- FreeBSD: whereis(1) 15.1-RELEASE
- OpenBSD: whereis(1) 8.0
- NetBSD: whereis(1) 11.0
What Solnix runs
A default Solnix system runs the illumos /usr/ucb/whereis, published as whereis(1b). No other variants are shipped. The page is in the BSD-compatibility section (1B), and its SYNOPSIS gives the full path /usr/ucb/whereis.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, FreeBSD | where it searches | Solnix searches a fixed list of directories (/sbin, /usr/bin, /usr/ucb, /usr/local/bin and others). The page does not mention $PATH or $MANPATH. Linux also searches $PATH and $MANPATH. FreeBSD searches user.cs_path plus /usr/libexec and $PATH, and manual pages along $MANPATH.Source: Solnix whereis(1b) DESCRIPTION (list of standard places); Linux whereis(1) DESCRIPTION; FreeBSD whereis(1) DESCRIPTION |
| OpenBSD, NetBSD | binaries only | Solnix looks for binaries, manual sections and sources, and -b, -m and -s select among them. OpenBSD and NetBSD check only binary directories, and their synopses have no -b, -m or -s.Source: Solnix whereis(1b) SYNOPSIS, -b, -m, -s; OpenBSD whereis(1) SYNOPSIS, DESCRIPTION; NetBSD whereis(1) SYNOPSIS, DESCRIPTION |
| OpenBSD, NetBSD | flags that exist | OpenBSD whereis accepts only -a. NetBSD accepts only -p, and its COMPATIBILITY section says the historic flags and arguments are no longer available. A script using Solnix flags such as -b or -B will not work on either.Source: OpenBSD whereis(1) SYNOPSIS; NetBSD whereis(1) SYNOPSIS, COMPATIBILITY; Solnix whereis(1b) SYNOPSIS |
| FreeBSD, OpenBSD | -a (all matches) | FreeBSD and OpenBSD -a report all matches instead of only the first. Solnix has no -a, and its page does not say whether it reports one match or all.Source: FreeBSD whereis(1) -a; OpenBSD whereis(1) -a; Solnix whereis(1b) SYNOPSIS |
| NetBSD | -p meaning | On NetBSD, -p makes whereis search the PATH environment variable instead of the user.cs_path default. Solnix has no -p.Source: NetBSD whereis(1) DESCRIPTION, SYNOPSIS; Solnix whereis(1b) SYNOPSIS |
| Linux, FreeBSD | -B, -M, -S directory lists | On Solnix, directories given to -B, -M or -S must be full paths starting with /, because whereis uses chdir(2). -f must end the list. Linux takes a whitespace-separated list per option. FreeBSD says these options require -f.Source: Solnix whereis(1b) BUGS, -f; Linux whereis(1) -B, -M, -S, -f; FreeBSD whereis(1) -B, -M, -S, -f |
| Linux | per-name search masks | On Linux, -b, -m, -s, -B, -M and -S apply to the names that follow them, so `whereis -bm ls tr -m gcc` mixes restrictions. The Solnix page documents no such positional behaviour; its synopsis puts all options before the filenames.Source: Linux whereis(1) DESCRIPTION; Solnix whereis(1b) SYNOPSIS |
| Linux, FreeBSD | -u unusual entries | Solnix -u selects files that lack one entry of each requested type. Linux selects commands without exactly one entry of each explicitly requested type, so it also reports duplicates. FreeBSD prints only the name of the unusual entry. The wording differs, so check each page.Source: Solnix whereis(1b) -u; Linux whereis(1) -u; FreeBSD whereis(1) -u |
| Linux, FreeBSD | name stripping | Solnix strips path components, one trailing .ext and an s. prefix. FreeBSD strips one trailing gzip, compress or bzip2 extension, a leading s. and a trailing ,v. The Linux page mentions only path components and the s. prefix. Source: Solnix whereis(1b) DESCRIPTION; FreeBSD whereis(1) DESCRIPTION; Linux whereis(1) DESCRIPTION |
| OpenBSD, NetBSD | exit status | OpenBSD exits 0 if all names resolved, 1 if some did, 2 if none did. NetBSD exits 0 on success, 1 on general error, 2 if some programs were found, 3 if none. The Solnix page documents no exit status. Source: OpenBSD whereis(1) EXIT STATUS; NetBSD whereis(1) EXIT STATUS; Solnix whereis(1b) (no such section) |
| Linux, FreeBSD | extra options | Linux has -l (print lookup paths), -g (glob patterns), -h and -V. FreeBSD has -q (omit the name before output) and -x (do not ask locate(1) for sources). Solnix has none of these.Source: Linux whereis(1) -l, -g, -h, -V; FreeBSD whereis(1) -q, -x; Solnix whereis(1b) SYNOPSIS |
| Linux | debug environment variable | Linux reads WHEREIS_DEBUG=all to enable debug output. The Solnix page documents no environment variables. Source: Linux whereis(1) ENVIRONMENT; Solnix whereis(1b) |
Standards
- POSIX: whereis is not a POSIX.1-2024 utility.
Writing portable scripts
- Use only `whereis name` in portable scripts. Every flag beyond that differs:
-aexists on FreeBSD and OpenBSD,-pon NetBSD, and-b,-m,-son Solnix, Linux and FreeBSD. - If you must use
-B,-Mor-S, give absolute directories and end the list with-f. This works on Solnix, Linux and FreeBSD but not on OpenBSD or NetBSD.
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.