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