1 .\" Copyright (c) 2011, Mark R. Bannister <cambridge@users.sourceforge.net>
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
24 .TH GETENT 1 2013-03-15 "Linux" "User Commands"
26 getent \- get entries from Name Service Switch libraries
29 .IR database " [" key " ...]"
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.
346 One of the following exit values can be returned by
351 Command completed successfully.
354 Missing arguments, or
361 could not be found in the
365 Enumeration not supported on this
369 .BR nsswitch.conf (5)