Annotation of src/usr.bin/getent/getent.1, Revision 1.12
1.12 ! schwarze 1: .\" $OpenBSD: getent.1,v 1.11 2014/02/12 17:23:25 schwarze 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: .\"
19: .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20: .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21: .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22: .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23: .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24: .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25: .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26: .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27: .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28: .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29: .\" POSSIBILITY OF SUCH DAMAGE.
30: .\"
1.12 ! schwarze 31: .Dd $Mdocdate: February 12 2014 $
1.1 otto 32: .Dt GETENT 1
33: .Os
34: .Sh NAME
35: .Nm getent
36: .Nd get entries from administrative database
37: .Sh SYNOPSIS
38: .Nm
39: .Ar database
40: .Op Ar key ...
41: .Sh DESCRIPTION
42: The
43: .Nm
44: program retrieves and displays entries from the administrative
45: database specified by
1.4 jmc 46: .Ar database .
47: The order in which entries are looked up
48: is defined by the specific database
49: (for example, the lookup order for the
50: .Dq hosts
51: database is determined by
52: .Xr resolv.conf 5 ) .
1.1 otto 53: The display format for a given
54: .Ar database
55: is as per the
56: .Dq traditional
57: file format for that database.
58: .Pp
59: .Ar database
60: may be one of:
1.10 jmc 61: .Bl -column "netgroup" -offset indent
1.7 schwarze 62: .It Sy Database Ta Sy Display format
1.1 otto 63: .It ethers Ta address name
64: .It group Ta group:passwd:gid:[member[,member]...]
65: .It hosts Ta address name [alias ...]
66: .It passwd Ta user:passwd:uid:gid:gecos:home_dir:shell
67: .It protocols Ta name protocol [alias ...]
68: .It rpc Ta name number [alias ...]
69: .It services Ta name port/protocol [alias ...]
70: .It shells Ta /path/to/shell
71: .El
72: .Pp
73: If one or more
74: .Ar key
75: arguments are provided, they will be looked up in
76: .Ar database
77: using the appropriate function.
78: For example,
1.11 schwarze 79: .Cm passwd
1.1 otto 80: supports a numeric UID or user name;
1.11 schwarze 81: .Cm hosts
1.1 otto 82: supports an IPv4 address, IPv6 address, or host name;
83: and
1.11 schwarze 84: .Cm services
1.1 otto 85: supports a service name, service name/protocol name, numeric port, or
86: numeric port/protocol name.
87: .Pp
88: If no
89: .Ar key
90: is provided and
91: .Ar database
92: supports enumeration, all entries for
93: .Ar database
94: will be retrieved using the appropriate enumeration function and printed.
1.8 jmc 95: .Sh EXIT STATUS
96: The
1.1 otto 97: .Nm
1.9 jmc 98: utility exits with one of the following values:
1.8 jmc 99: .Pp
100: .Bl -tag -width Ds -offset indent -compact
101: .It 0
102: Success.
103: .It 1
104: There was an error in the command syntax.
105: .It 2
106: One of the specified key names was not found in
1.1 otto 107: .Ar database .
1.8 jmc 108: .It 3
109: There is no support for enumeration on
110: .Ar database .
111: .El
1.1 otto 112: .Sh SEE ALSO
113: .Xr ethers 5 ,
114: .Xr group 5 ,
115: .Xr hosts 5 ,
116: .Xr passwd 5 ,
117: .Xr protocols 5 ,
118: .Xr rpc 5 ,
119: .Xr services 5 ,
120: .Xr shells 5
121: .Sh HISTORY
122: A
123: .Nm
1.4 jmc 124: command first appeared in
1.3 otto 125: .Ox 3.9 .
1.1 otto 126: It was based on the command of the same name in
127: .Tn Solaris
128: and
129: .Tn Linux .