xref: /dflybsd-src/usr.bin/getent/getent.1 (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
1*86d7f5d3SJohn Marino.\" Copyright (c) 2004 The NetBSD Foundation, Inc.
2*86d7f5d3SJohn Marino.\" All rights reserved.
3*86d7f5d3SJohn Marino.\"
4*86d7f5d3SJohn Marino.\" This code is derived from software contributed to The NetBSD Foundation
5*86d7f5d3SJohn Marino.\" by Luke Mewburn.
6*86d7f5d3SJohn Marino.\"
7*86d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without
8*86d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions
9*86d7f5d3SJohn Marino.\" are met:
10*86d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
11*86d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer.
12*86d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
13*86d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
14*86d7f5d3SJohn Marino.\"    documentation and/or other materials provided with the distribution.
15*86d7f5d3SJohn Marino.\" 3. All advertising materials mentioning features or use of this software
16*86d7f5d3SJohn Marino.\"    must display the following acknowledgement:
17*86d7f5d3SJohn Marino.\"	This product includes software developed by the NetBSD
18*86d7f5d3SJohn Marino.\"	Foundation, Inc. and its contributors.
19*86d7f5d3SJohn Marino.\" 4. Neither the name of The NetBSD Foundation nor the names of its
20*86d7f5d3SJohn Marino.\"    contributors may be used to endorse or promote products derived
21*86d7f5d3SJohn Marino.\"    from this software without specific prior written permission.
22*86d7f5d3SJohn Marino.\"
23*86d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
24*86d7f5d3SJohn Marino.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25*86d7f5d3SJohn Marino.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26*86d7f5d3SJohn Marino.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
27*86d7f5d3SJohn Marino.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28*86d7f5d3SJohn Marino.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29*86d7f5d3SJohn Marino.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30*86d7f5d3SJohn Marino.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31*86d7f5d3SJohn Marino.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32*86d7f5d3SJohn Marino.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33*86d7f5d3SJohn Marino.\" POSSIBILITY OF SUCH DAMAGE.
34*86d7f5d3SJohn Marino.\"
35*86d7f5d3SJohn Marino.\" $NetBSD: getent.1,v 1.13 2005/09/11 23:16:15 wiz Exp $
36*86d7f5d3SJohn Marino.\" $FreeBSD: src/usr.bin/getent/getent.1,v 1.2 2006/09/30 17:27:50 ru Exp $
37*86d7f5d3SJohn Marino.\" $DragonFly: src/usr.bin/getent/getent.1,v 1.1 2007/12/04 18:13:09 dillon Exp $
38*86d7f5d3SJohn Marino.\"
39*86d7f5d3SJohn Marino.Dd August 24, 2005
40*86d7f5d3SJohn Marino.Dt GETENT 1
41*86d7f5d3SJohn Marino.Os
42*86d7f5d3SJohn Marino.Sh NAME
43*86d7f5d3SJohn Marino.Nm getent
44*86d7f5d3SJohn Marino.Nd get entries from administrative database
45*86d7f5d3SJohn Marino.Sh SYNOPSIS
46*86d7f5d3SJohn Marino.Nm
47*86d7f5d3SJohn Marino.Ar database
48*86d7f5d3SJohn Marino.Op Ar key ...
49*86d7f5d3SJohn Marino.Sh DESCRIPTION
50*86d7f5d3SJohn MarinoThe
51*86d7f5d3SJohn Marino.Nm
52*86d7f5d3SJohn Marinoutility retrieves and displays entries from the administrative
53*86d7f5d3SJohn Marinodatabase specified by
54*86d7f5d3SJohn Marino.Ar database ,
55*86d7f5d3SJohn Marinousing the lookup order specified in
56*86d7f5d3SJohn Marino.Xr nsswitch.conf 5 .
57*86d7f5d3SJohn MarinoThe display format for a given
58*86d7f5d3SJohn Marino.Ar database
59*86d7f5d3SJohn Marinois as per the
60*86d7f5d3SJohn Marino.Dq traditional
61*86d7f5d3SJohn Marinofile format for that database.
62*86d7f5d3SJohn Marino.Pp
63*86d7f5d3SJohn MarinoThe
64*86d7f5d3SJohn Marino.Ar database
65*86d7f5d3SJohn Marinoargument may be one of:
66*86d7f5d3SJohn Marino.Pp
67*86d7f5d3SJohn Marino.Bl -column ".Li netgroup" -offset indent -compact
68*86d7f5d3SJohn Marino.It Sy Database Ta Sy Display format
69*86d7f5d3SJohn Marino.It Li ethers Ta address name
70*86d7f5d3SJohn Marino.It Li group Ta group:passwd:gid:[member[,member]...]
71*86d7f5d3SJohn Marino.It Li hosts Ta address name [alias ...]
72*86d7f5d3SJohn Marino.It Li networks Ta name network [alias ...]
73*86d7f5d3SJohn Marino.It Li passwd Ta user:passwd:uid:gid:gecos:home_dir:shell
74*86d7f5d3SJohn Marino.It Li protocols Ta name protocol [alias ...]
75*86d7f5d3SJohn Marino.It Li rpc Ta name number [alias ...]
76*86d7f5d3SJohn Marino.It Li services Ta name port/protocol [alias ...]
77*86d7f5d3SJohn Marino.It Li shells Ta /path/to/shell
78*86d7f5d3SJohn Marino.El
79*86d7f5d3SJohn Marino.Pp
80*86d7f5d3SJohn MarinoIf one or more
81*86d7f5d3SJohn Marino.Ar key
82*86d7f5d3SJohn Marinoarguments are provided, they will be looked up in
83*86d7f5d3SJohn Marino.Ar database
84*86d7f5d3SJohn Marinousing the appropriate function.
85*86d7f5d3SJohn MarinoFor example,
86*86d7f5d3SJohn Marino.Dq Li passwd
87*86d7f5d3SJohn Marinosupports a numeric UID or user name;
88*86d7f5d3SJohn Marino.Dq Li hosts
89*86d7f5d3SJohn Marinosupports an IPv4 address, IPv6 address, or host name;
90*86d7f5d3SJohn Marinoand
91*86d7f5d3SJohn Marino.Dq Li services
92*86d7f5d3SJohn Marinosupports a service name, service name/protocol name, numeric port, or
93*86d7f5d3SJohn Marinonumeric port/protocol name.
94*86d7f5d3SJohn Marino.Pp
95*86d7f5d3SJohn MarinoIf no
96*86d7f5d3SJohn Marino.Ar key
97*86d7f5d3SJohn Marinois provided and
98*86d7f5d3SJohn Marino.Ar database
99*86d7f5d3SJohn Marinosupports enumeration, all entries for
100*86d7f5d3SJohn Marino.Ar database
101*86d7f5d3SJohn Marinowill be retrieved using the appropriate enumeration function and printed.
102*86d7f5d3SJohn Marino.Sh EXIT STATUS
103*86d7f5d3SJohn MarinoThe
104*86d7f5d3SJohn Marino.Nm
105*86d7f5d3SJohn Marinoutility exits 0 on success,
106*86d7f5d3SJohn Marino1 if there was an error in the command syntax,
107*86d7f5d3SJohn Marino2 if one of the specified key names was not found in
108*86d7f5d3SJohn Marino.Ar database ,
109*86d7f5d3SJohn Marinoor 3 if there is no support for enumeration on
110*86d7f5d3SJohn Marino.Ar database .
111*86d7f5d3SJohn Marino.Sh SEE ALSO
112*86d7f5d3SJohn Marino.Xr ethers 5 ,
113*86d7f5d3SJohn Marino.Xr group 5 ,
114*86d7f5d3SJohn Marino.Xr hosts 5 ,
115*86d7f5d3SJohn Marino.Xr networks 5 ,
116*86d7f5d3SJohn Marino.Xr nsswitch.conf 5 ,
117*86d7f5d3SJohn Marino.Xr passwd 5 ,
118*86d7f5d3SJohn Marino.Xr protocols 5 ,
119*86d7f5d3SJohn Marino.Xr rpc 5 ,
120*86d7f5d3SJohn Marino.Xr services 5 ,
121*86d7f5d3SJohn Marino.Xr shells 5
122*86d7f5d3SJohn Marino.Sh HISTORY
123*86d7f5d3SJohn MarinoA
124*86d7f5d3SJohn Marino.Nm
125*86d7f5d3SJohn Marinocommand appeared in
126*86d7f5d3SJohn Marino.Nx 3.0 ,
127*86d7f5d3SJohn Marinoand was imported into
128*86d7f5d3SJohn Marino.Fx 7.0 .
129*86d7f5d3SJohn MarinoIt was based on the command of the same name in
130*86d7f5d3SJohn Marino.Tn Solaris
131*86d7f5d3SJohn Marinoand
132*86d7f5d3SJohn Marino.Tn Linux .
133