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
27 .BI "getent " database " [ " key " ... ]"
31 command displays entries from databases supported by the
32 Name Service Switch libraries,
33 which are configured in
34 .IR /etc/nsswitch.conf .
37 arguments are provided,
38 then only the entries that match the supplied keys will be displayed.
41 is provided, all entries will be displayed (unless the database does not
46 may be any of those supported by the GNU C Library, listed below:
57 to enumerate the hosts database.
58 This is identical to using
62 arguments are provided, pass each
66 with the address family
68 enumerating each socket address structure returned.
73 but use the address family
79 but use the address family
83 in this case includes the
95 to enumerate the aliases database.
98 arguments are provided, pass each
101 .BR getaliasbyname (3)
102 and display the result.
107 arguments are provided, pass each
112 .BR ether_hostton (3)
113 until a result is obtained, and display the result.
114 Enumeration is not supported on
128 to enumerate the group database.
131 arguments are provided, pass each numeric
139 and display the result.
149 to enumerate the gshadow database.
152 arguments are provided, pass each
156 and display the result.
166 to enumerate the hosts database.
169 arguments are provided, pass each
172 .BR gethostbyaddr (3)
174 .BR gethostbyname2 (3),
175 depending on whether a call to
179 is an IPv6 or IPv4 address or not, and display the result.
184 arguments are provided, pass each
188 and display the result.
189 Enumeration is not supported on
198 is provided, pass the
204 display the resulting string triple
205 .RI ( hostname ", " username ", " domainname ).
208 may be provided, which are interpreted as the
213 to match to a netgroup name via
215 Enumeration is not supported on
217 so either one or three
229 to enumerate the networks database.
232 arguments are provided, pass each numeric
240 and display the result.
250 to enumerate the passwd database.
253 arguments are provided, pass each numeric
261 and display the result.
271 to enumerate the protocols database.
274 arguments are provided, pass each numeric
277 .BR getprotobynumber (3)
281 .BR getprotobyname (3)
282 and display the result.
292 to enumerate the rpc database.
295 arguments are provided, pass each numeric
298 .BR getrpcbynumber (3)
303 and display the result.
313 to enumerate the services database.
316 arguments are provided, pass each numeric
319 .BR getservbynumber (3)
323 .BR getservbyname (3)
324 and display the result.
334 to enumerate the shadow database.
337 arguments are provided, pass each
341 and display the result.
344 One of the following exit values can be returned by
349 Command completed successfully.
352 Missing arguments, or
359 could not be found in the
363 Enumeration not supported on this
367 .BR nsswitch.conf (5)