getent gets a list of entries from the administrative database specified by database. The information comes from one or more of the sources that are specified for the database in /etc/nsswitch.conf.
database is the name of the database to be examined. This can be passwd, group, hosts, services, protocols, ethers, or networks. For each of these databases, it uses the appropriate library routines described in getpwnam.3c getgrnam.3c gethostbyname.3n getservbyname.3n getprotobyname.3n ethers.3n and getnetbyname.3n respectively.
Each key must be in a format appropriate for searching on the respective database; for example, it can be a username or numeric-uid for passwd, hostname or IP address for hosts, or service, service/protocol, port, or port/proto for services.
getent prints out the database entries that match each of the supplied keys, one per line, in the format of the matching administrative file: passwd.4 group.4 hosts.4 services.4 protocols.4 ethers.4 or networks.4 If no key is given, all entries returned by the corresponding enumeration library routine (for example, getpwent or gethostent) are printed.
Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97