Linux "getent" Command Line Options and Examples
get entries from Name Service Switch libraries

The getent command displays entries from databases supported by the Name Service Switch libraries, which are configured in /etc/nss‐ witch.conf. If one or more key arguments are provided, then only the entries that match the supplied keys will be displayed.


Usage:

getent [option]... database key...




Command Line Options:

-s
Override all databases with the specified service. (Since glibc 2.2.5.)
getent -s ...
-i
Disables IDN encoding in lookups for ahosts/getaddrinfo(3) (Since glibc-2.13.)
getent -i ...
-?
Print a usage summary and exit.
getent -? ...
--usage
Print a short usage summary and exit.
getent --usage ...
-V
Print the version number, license, and disclaimer of warranty for getent.EXIT STATUSOne of the following exit values can be returned by getent:0 Command completed successfully.1 Missing arguments, or database unknown.2 One or more supplied key could not be found in the database.3 Enumeration not supported on this database.
getent -V ...