getent(8) on Solnix vs Linux and the BSDs
On Solnix, getent is the illumos getent at /usr/bin/getent. It takes `database [key]...` and no options. It adds illumos databases (project, auth_attr, exec_attr, prof_attr, user_attr, ipnodes, netmasks) and lacks the Linux options and the rpc and shells databases that the Linux and BSD pages list.
The manual pages
What Solnix runs
A default Solnix system runs the illumos getent at /usr/bin/getent. No other variants are shipped. The Solnix page is in section 8, while the Linux and BSD counterparts are getent(1).
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux | options | Linux getent accepts -s/--service, -i/--no-idn, -V/--version, --help and --usage before the database. The Solnix synopsis is only `getent database [key]...` and the page documents no options.Source: Linux getent(1) SYNOPSIS, OPTIONS; Solnix getent(8) SYNOPSIS |
| Linux | overriding the nsswitch source | Linux -s service or -s database:service forces a specific NSS service for a lookup. The Solnix page documents no such override. It reads the sources listed in /etc/nsswitch.conf.Source: Linux getent(1) --service; Solnix getent(8) DESCRIPTION |
| all four | illumos-only databases | Solnix getent can query project, ipnodes, netmasks, auth_attr, exec_attr, prof_attr and user_attr. None of these appear in the Linux, FreeBSD, OpenBSD or NetBSD database lists. Source: Solnix getent(8) DESCRIPTION (database list); Linux getent(1) DESCRIPTION; FreeBSD/OpenBSD/NetBSD getent(1) database tables |
| all four | rpc database | The Solnix database list has no rpc. Linux, FreeBSD, OpenBSD and NetBSD all document `getent rpc`. Source: Solnix getent(8) DESCRIPTION; Linux getent(1) rpc; FreeBSD/OpenBSD/NetBSD getent(1) rpc |
| FreeBSD, OpenBSD, NetBSD | shells database | The Solnix database list has no shells. FreeBSD, OpenBSD and NetBSD document `getent shells`, which prints /path/to/shell lines. Source: Solnix getent(8) DESCRIPTION; FreeBSD/OpenBSD/NetBSD getent(1) shells |
| Linux, FreeBSD, NetBSD | other database names | The Solnix list has none of these. Linux documents ahosts, ahostsv4, ahostsv6, aliases, gshadow and initgroups. FreeBSD documents utmpx. NetBSD documents disktab, gettytab and printcap. Source: Linux getent(1) DESCRIPTION; FreeBSD getent(1) utmpx; NetBSD getent(1) database table; Solnix getent(8) DESCRIPTION |
| Linux | numeric passwd and group keys | Solnix treats an all-digit key as an ID first. If no match is found it retries the key as a name. Linux sends numeric keys to getpwuid/getgrgid and non-numeric keys to getpwnam/getgrnam. The Linux page documents no retry. Source: Solnix getent(8) Key Interpretation for passwd, group; Linux getent(1) passwd, group |
| Linux | netgroup key syntax | Solnix takes one key of the form `netgroup [host user domain]`, with * as a wildcard. Linux takes one key, or three separate keys (host, user, domain). The Solnix page does not say it accepts three separate arguments. Source: Solnix getent(8) Key Interpretation for netgroup; Linux getent(1) netgroup |
| OpenBSD | netgroup availability | Solnix documents getent netgroup. The OpenBSD database table does not list netgroup. Source: Solnix getent(8) DESCRIPTION; OpenBSD getent(1) database table |
| Linux | enumeration limits | Solnix does not support enumeration on ipnodes, ethers, netgroup or netmasks. Linux lists ethers, initgroups and netgroup as non-enumerable. Do not assume a bare `getent netmasks` works on both. Source: Solnix getent(8) DESCRIPTION; Linux getent(1) ethers, initgroups, netgroup |
| Linux, OpenBSD | exit status 1 | Solnix exit 1 covers a syntax error, an invalid option or an internal error. Linux says 1 means missing arguments or an unknown database. OpenBSD and FreeBSD say a syntax error. Codes 2 and 3 mean the same everywhere. Source: Solnix getent(8) EXIT STATUS; Linux getent(1) EXIT STATUS; OpenBSD getent(1) EXIT STATUS; FreeBSD getent(1) EXIT STATUS |
| NetBSD | exit status and getcap | The NetBSD page has no EXIT STATUS section. It also installs getcap, and for disktab and printcap it returns true or false for boolean keys. Solnix has no getcap or cgetcap-style databases in its list. Source: NetBSD getent(1) SYNOPSIS, DESCRIPTION; Solnix getent(8) EXIT STATUS |
| OpenBSD | lookup order | Solnix takes sources from /etc/nsswitch.conf. OpenBSD says the lookup order is defined per database, and for hosts it comes from resolv.conf(5).Source: Solnix getent(8) DESCRIPTION; OpenBSD getent(1) DESCRIPTION |
Standards
- POSIX: getent is not a POSIX.1-2024 utility.
- FreeBSD: HISTORY: a getent command appeared in NetBSD 3.0 and was imported into FreeBSD 7.0, based on the command of the same name in Solaris and Linux.
- OpenBSD: HISTORY: a getent command first appeared in OpenBSD 3.9, based on the command of the same name in Solaris and Linux.
- NetBSD: HISTORY: a getent command appeared in NetBSD 3.0, based on the command of the same name in Solaris and Linux.
Writing portable scripts
- Use only the form `getent database key`, with no options, and only the passwd, group, hosts, services, protocols and ethers databases. All five pages document these.
- Test for exit status 2 (key not found) rather than parsing output. Exit 3 means the database cannot be enumerated.
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.