1 .\" Copyright (c) 2011, Mark R. Bannister <cambridge@users.sourceforge.net>
2 .\" Copyright (c) 2015, Robin H. Johnson <robbat2@gentoo.org>
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
25 .TH GETENT 1 2019-03-06 "Linux" "User Commands"
27 getent \- get entries from Name Service Switch libraries
29 .B getent\ [\fIoption\fP]...\ \fIdatabase\fP\ \fIkey\fP...
33 command displays entries from databases supported by the
34 Name Service Switch libraries,
35 which are configured in
36 .IR /etc/nsswitch.conf .
39 arguments are provided,
40 then only the entries that match the supplied keys will be displayed.
43 is provided, all entries will be displayed (unless the database does not
48 may be any of those supported by the GNU C Library, listed below:
59 to enumerate the hosts database.
60 This is identical to using
64 arguments are provided, pass each
68 with the address family
70 enumerating each socket address structure returned.
75 but use the address family
81 but use the address family
85 in this case includes the
97 to enumerate the aliases database.
100 arguments are provided, pass each
103 .BR getaliasbyname (3)
104 and display the result.
109 arguments are provided, pass each
114 .BR ether_hostton (3)
115 until a result is obtained, and display the result.
116 Enumeration is not supported on
130 to enumerate the group database.
133 arguments are provided, pass each numeric
141 and display the result.
151 to enumerate the gshadow database.
154 arguments are provided, pass each
158 and display the result.
168 to enumerate the hosts database.
171 arguments are provided, pass each
174 .BR gethostbyaddr (3)
176 .BR gethostbyname2 (3),
177 depending on whether a call to
181 is an IPv6 or IPv4 address or not, and display the result.
186 arguments are provided, pass each
190 and display the result.
191 Enumeration is not supported on
200 is provided, pass the
206 display the resulting string triple
207 .RI ( hostname ", " username ", " domainname ).
210 may be provided, which are interpreted as the
215 to match to a netgroup name via
217 Enumeration is not supported on
219 so either one or three
231 to enumerate the networks database.
234 arguments are provided, pass each numeric
242 and display the result.
252 to enumerate the passwd database.
255 arguments are provided, pass each numeric
263 and display the result.
273 to enumerate the protocols database.
276 arguments are provided, pass each numeric
279 .BR getprotobynumber (3)
283 .BR getprotobyname (3)
284 and display the result.
294 to enumerate the rpc database.
297 arguments are provided, pass each numeric
300 .BR getrpcbynumber (3)
305 and display the result.
315 to enumerate the services database.
318 arguments are provided, pass each numeric
321 .BR getservbynumber (3)
325 .BR getservbyname (3)
326 and display the result.
336 to enumerate the shadow database.
339 arguments are provided, pass each
343 and display the result.
347 .BR \-s\ \fIservice\fP ", " \-\-service\ \fIservice\fP
348 .\" commit 9d0881aa76b399e6a025c5cf44bebe2ae0efa8af (glibc)
349 Override all databases with the specified service.
352 .BR \-s\ \fIdatabase\fP:\fIservice\fP ", "\
353 \-\-service\ \fIdatabase\fP:\fIservice\fP
354 .\" commit b4f6f4be85d32b9c03361c38376e36f08100e3e8 (glibc)
355 Override only specified databases with the specified service.
356 The option may be used multiple times,
357 but only the last service for each database will be used.
360 .BR \-i ", " \-\-no\-idn
361 .\" commit a160f8d808cf8020b13bd0ef4a9eaf3c11f964ad (glibc)
362 Disables IDN encoding in lookups for
363 .BR ahosts / getaddrinfo (3)
366 .BR \-? ", " \-\-help
367 Print a usage summary and exit.
370 Print a short usage summary and exit.
372 .BR \-V ", " \-\-version
373 Print the version number, license, and disclaimer of warranty for
376 One of the following exit values can be returned by
381 Command completed successfully.
384 Missing arguments, or
391 could not be found in the
395 Enumeration not supported on this
399 .BR nsswitch.conf (5)