1 .\" Copyright (c) 2011, Mark R. Bannister <cambridge@users.sourceforge.net>
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 .\" GNU General Public License for more details.
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
23 .TH GETENT 1 2011-10-31 "Linux" "User Commands"
25 getent \- get entries from Name Service Switch libraries
28 .IR database " [" key " ...]"
32 command displays entries from databases supported by the
33 Name Service Switch libraries,
34 which are configured in
35 .IR /etc/nsswitch.conf .
38 arguments are provided,
39 then only the entries that match the supplied keys will be displayed.
42 is provided, all entries will be displayed (unless the database does not
47 may be any of those supported by the GNU C Library, listed below:
58 to enumerate the hosts database.
59 This is identical to using
63 arguments are provided, pass each
67 with the address family
69 enumerating each socket address structure returned.
74 but use the address family
80 but use the address family
84 in this case includes the
96 to enumerate the aliases database.
99 arguments are provided, pass each
102 .BR getaliasbyname (3)
103 and display the result.
108 arguments are provided, pass each
113 .BR ether_hostton (3)
114 until a result is obtained, and display the result.
115 Enumeration is not supported on
129 to enumerate the group database.
132 arguments are provided, pass each numeric
140 and display the result.
150 to enumerate the gshadow database.
153 arguments are provided, pass each
157 and display the result.
167 to enumerate the hosts database.
170 arguments are provided, pass each
173 .BR gethostbyaddr (3)
175 .BR gethostbyname2 (3),
176 depending on whether a call to
180 is an IPv6 or IPv4 address or not, and display the result.
185 arguments are provided, pass each
189 and display the result.
190 Enumeration is not supported on
199 is provided, pass the
205 display the resulting string triple
206 .RI ( hostname ", " username ", " domainname ).
209 may be provided, which are interpreted as the
214 to match to a netgroup name via
216 Enumeration is not supported on
218 so either one or three
230 to enumerate the networks database.
233 arguments are provided, pass each numeric
241 and display the result.
251 to enumerate the passwd database.
254 arguments are provided, pass each numeric
262 and display the result.
272 to enumerate the protocols database.
275 arguments are provided, pass each numeric
278 .BR getprotobynumber (3)
282 .BR getprotobyname (3)
283 and display the result.
293 to enumerate the rpc database.
296 arguments are provided, pass each numeric
299 .BR getrpcbynumber (3)
304 and display the result.
314 to enumerate the services database.
317 arguments are provided, pass each numeric
320 .BR getservbynumber (3)
324 .BR getservbyname (3)
325 and display the result.
335 to enumerate the shadow database.
338 arguments are provided, pass each
342 and display the result.
345 One of the following exit values can be returned by
350 Command completed successfully.
353 Missing arguments, or
360 could not be found in the
364 Enumeration not supported on this
368 .BR nsswitch.conf (5)