getent - get entries from administrative database
getent database [key]...
getent gets a list of entries from the administrative database specified by database. The information generally 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, ipnodes, services, protocols, ethers, project, networks, or netmasks. For each of these databases, getent uses the appropriate library routines described in getpwnam(3C), getgrnam(3C), gethostbyaddr(3NSL), gethostbyname(3NSL), getipnodebyaddr(3SOCKET), getipnodebyname(3SOCKET), getservbyname(3SOCKET), getprotobyname(3SOCKET), ethers(3SOCKET), getprojbyname(3PROJECT) and getnetbyname(3SOCKET), 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), project(4), hosts(4), services(4), protocols(4), ethers(3SOCKET), networks(4), or netmasks(4). If no key is given, all entries returned by the corresponding enumeration library routine, for example, getpwent() or gethostent(), are printed. Enumeration is not supported on ipnodes.
When getent is invoked with database set to passwd, each key value is processed as follows:
Similarly, when getent is invoked with database set to group, each key value is processed as follows:
The following exit values are returned:
0
1
2
3
/etc/nsswitch.conf
/etc/passwd
/etc/group
/etc/inet/hosts
/etc/services
/etc/project
/etc/protocols
/etc/ethers
/etc/networks
/etc/netmasks
See attributes(5) for descriptions of the following attributes:
|
ethers(3SOCKET), getgrnam(3C), gethostbyaddr(3NSL), gethostbyname(3NSL), gethostent(3NSL), getipnodebyaddr(3SOCKET), getipnodebyname(3SOCKET), getnetbyname(3SOCKET), getprojbyname(3PROJECT), getprotobyname(3SOCKET), getpwnam(3C), getservbyname(3SOCKET), group(4), hosts(4), netmasks(4), networks(4), nsswitch.conf(4), passwd(4), project(4), protocols(4), services(4), attributes(5)
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |