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.

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 withTopicWhat differs
LinuxoptionsLinux 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
Linuxoverriding the nsswitch sourceLinux -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 fourillumos-only databasesSolnix 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 fourrpc databaseThe 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, NetBSDshells databaseThe 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, NetBSDother database namesThe 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
Linuxnumeric passwd and group keysSolnix 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
Linuxnetgroup key syntaxSolnix 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
OpenBSDnetgroup availabilitySolnix documents getent netgroup. The OpenBSD database table does not list netgroup.
Source: Solnix getent(8) DESCRIPTION; OpenBSD getent(1) database table
Linuxenumeration limitsSolnix 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, OpenBSDexit status 1Solnix 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
NetBSDexit status and getcapThe 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
OpenBSDlookup orderSolnix 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.