GETENT(1)
β¨ GETENT(1) β the getent girlies' era β¨
okay so this is the manual page for getent (and its twin getcap), from the General Commands Manual, and honestly bestie, it's lowkey a whole vibe. it's your lil cheat code for peeking inside the system's administrative databases. let's get into it π
πΈ NAME πΈ
getent, getcap β get entries from administrative databases β¨ (yes that's the whole name section, she's short and iconic)
π SYNOPSIS π
getent database [key ...]
getcap database [key ...]
like, that's it. two commands, one shape. slay.
π¦ DESCRIPTION π¦
okay so the getent program retrieves and displays entries from the administrative database specified by database, using the lookup order specified in nsswitch.conf(5). the display format for a given database is as per the "traditional" file format for that database. periodt. π
database may be one of:
disktabβ display format: entryethersβ display format: address namegettytabβ display format: entrygroupβ display format:group:passwd:gid:[member[,member]...]hostsβ display format: address name [alias ...]netgroupβ display format: (host,user,domain) [...]networksβ display format: name network [alias ...]passwdβ display format:user:passwd:uid:gid:gecos:home_dir:shellprintcapβ display format: entryprotocolsβ display format: name protocol [alias ...]rpcβ display format: name number [alias ...]servicesβ display format: name port/protocol [alias ...]shellsβ display format:/path/to/shell
okay now the fun part π«Ά if one or more key arguments are provided, they will be looked up in database using the appropriate function. for example, passwd supports a numeric UID or user name; hosts supports an IPv4 address, IPv6 address, or host name; and services supports a service name, service name/protocol name, numeric port, or numeric port/protocol name. so like, she's flexible. she contains multitudes. π
if no key is provided and database supports enumeration, all entries for database will be retrieved using the appropriate enumeration function and printed. basically you get the whole roster, no filter, main character energy π
and now the niche lore for the cgetcap(3) style databases (disktab, printcap) β ngl this part is giving special-case central π€ specifying a key lists the entry for that key, and specifying more arguments after the key are used as fields in that key, and only the values of the keys are returned. for boolean keys true is returned if the key is found. if a key is not found, then false is always returned. no cap, that's literally the rule. π
π₯ DIAGNOSTICS π₯
getent exits 0 on success, 1 if there was an error in the command syntax, 2 if one of the specified key names was not found in database, or 3 if there is no support for enumeration on database.
bestie memorize those numbers, they're the vibe check results:0slay,1you fumbled the syntax,2she's not in the database,3enumeration is just not her thing π
π SEE ALSO π
cgetcap(3), disktab(5), ethers(5), gettytab(5), group(5), hosts(5), networks(5), nsswitch.conf(5), passwd(5), printcap(5), protocols(5), rpc(5), services(5), shells(5)
(go read those too, iykyk π§)
β HISTORY β
a getent command appeared in NetBSD 3.0. it was based on the command of the same name in Solaris and Linux. so she's got lineage, she's got roots, she's a nepo baby of the Unix world and we love her for it π
and that's the whole manual, bestie β you ate that π
this page is from Debian, dated October 11, 2011 β yeah she's an older icon but she still serves πβ¨
π¦ where this page comes from
- nixpkgs unstable: getent-netbsd 11.0
- Copyright (c) 2004 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms