| Main index | Section 1 | Options |
The database argument may be one of:
| Display format | |
| ethers | address name |
| group | group:passwd:gid:[member[,member]...] |
| hosts | address name [alias ...] |
| netgroup | (host,user,domain) [...] |
| networks | name network [alias ...] |
| passwd | user:passwd:uid:gid:gecos:home_dir:shell |
| protocols | name protocol [alias ...] |
| rpc | name number [alias ...] |
| services | name port/protocol [alias ...] |
| shells | /path/to/shell |
| utmpx | [time] type: properties |
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.
If no key is provided and database supports enumeration, all entries for database will be retrieved using the appropriate enumeration function and printed.
$ getent passwd sshd sshd:*:22:22:Secure Shell Daemon:/var/empty:/usr/sbin/nologin
Show entry for TCP from the protocols database:
$ getent protocols tcp tcp 6 TCP
Show entry for the localhost IPv6 address ::1 from the hosts database:
$ getent hosts ::1 ::1 localhost localhost.my.domain
| GETENT (1) | October 24, 2020 |
| Main index | Section 1 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Ken Thompson has an automobile which he helped design. Unlike most automobiles, it has neither speedometer, nor gas gauge, nor any of the other numerous idiot lights which plague the modern driver. Rather, if the driver makes a mistake, a giant “?” lights up in the center of the dashboard. “The experienced driver,” says Thompson, “will usually know what's wrong.” | ” |