Annotation of src/usr.bin/id/id.1, Revision 1.17
1.17 ! jmc 1: .\" $OpenBSD: id.1,v 1.16 2009/02/08 17:15:10 jmc Exp $
1.1 deraadt 2: .\" $NetBSD: id.1,v 1.5 1995/09/28 08:05:40 perry Exp $
3: .\"
4: .\" Copyright (c) 1991, 1993, 1994
5: .\" The Regents of the University of California. All rights reserved.
6: .\"
7: .\" This code is derived from software contributed to Berkeley by
8: .\" the Institute of Electrical and Electronics Engineers, Inc.
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.
1.10 millert 18: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 19: .\" may be used to endorse or promote products derived from this software
20: .\" without specific prior written permission.
21: .\"
22: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32: .\" SUCH DAMAGE.
33: .\"
34: .\" @(#)id.1 8.2 (Berkeley) 5/5/94
35: .\"
1.17 ! jmc 36: .Dd $Mdocdate: February 8 2009 $
1.1 deraadt 37: .Dt ID 1
1.5 aaron 38: .Os
1.1 deraadt 39: .Sh NAME
40: .Nm id
41: .Nd return user identity
42: .Sh SYNOPSIS
43: .Nm id
44: .Op Ar user
45: .Nm id
46: .Fl G Op Fl n
47: .Op Ar user
48: .Nm id
49: .Fl g Op Fl nr
50: .Op Ar user
51: .Nm id
52: .Fl p
1.12 jmc 53: .Op Ar user
1.1 deraadt 54: .Nm id
55: .Fl u Op Fl nr
56: .Op Ar user
57: .Sh DESCRIPTION
58: The
1.7 aaron 59: .Nm
1.1 deraadt 60: utility displays the user and group names and numeric IDs, of the
61: calling process, to the standard output.
62: If the real and effective IDs are different, both are displayed,
63: otherwise only the real ID is displayed.
64: .Pp
65: If a
66: .Ar user
67: (login name or user ID)
68: is specified, the user and group IDs of that user are displayed.
69: In this case, the real and effective IDs are assumed to be the same.
70: .Pp
71: The options are as follows:
72: .Bl -tag -width Ds
73: .It Fl G
74: Display the different group IDs (effective, real and supplementary)
1.8 aaron 75: as whitespace separated numbers, in no particular order.
1.1 deraadt 76: .It Fl g
77: Display the effective group ID as a number.
78: .It Fl n
79: Display the name of the user or group ID for the
80: .Fl G ,
81: .Fl g
82: and
83: .Fl u
84: options instead of the number.
85: If any of the ID numbers cannot be mapped into names, the number will be
86: displayed as usual.
87: .It Fl p
88: Make the output human-readable.
89: If the user name returned by
90: .Xr getlogin 2
91: is different from the login name referenced by the user ID, the name
92: returned by
93: .Xr getlogin 2
1.9 aaron 94: is displayed, preceded by the keyword
95: .Dq login .
96: The user ID as a name is displayed, preceded by the keyword
97: .Dq uid .
1.1 deraadt 98: If the effective user ID is different from the real user ID, the real user
1.9 aaron 99: ID is displayed as a name, preceded by the keyword
100: .Dq euid .
1.1 deraadt 101: If the effective group ID is different from the real group ID, the real group
1.9 aaron 102: ID is displayed as a name, preceded by the keyword
103: .Dq rgid .
1.1 deraadt 104: The list of groups to which the user belongs is then displayed as names,
1.9 aaron 105: preceded by the keyword
106: .Dq groups .
1.1 deraadt 107: Each display is on a separate line.
108: .It Fl r
109: Display the real ID for the
110: .Fl g
111: and
112: .Fl u
113: options instead of the effective ID.
114: .It Fl u
115: Display the effective user ID as a number.
116: .El
1.17 ! jmc 117: .Sh EXIT STATUS
1.15 sobrado 118: .Ex -std id
1.1 deraadt 119: .Sh SEE ALSO
120: .Xr who 1
121: .Sh STANDARDS
122: The
1.7 aaron 123: .Nm
1.13 jmc 124: utility is compliant with the
1.16 jmc 125: .St -p1003.1-2008
1.13 jmc 126: specification.
127: .Pp
128: The flag
129: .Op Fl p
130: is an extension to that specification.
1.1 deraadt 131: .Sh HISTORY
132: The
133: historic
134: .Xr groups 1
135: command is equivalent to
1.9 aaron 136: .Ic id Fl Gn Op Ar user .
1.1 deraadt 137: .Pp
138: The
139: historic
140: .Xr whoami 1
141: command is equivalent to
1.11 jmc 142: .Ic id Fl un .
1.1 deraadt 143: .Pp
144: The
1.7 aaron 145: .Nm
1.1 deraadt 146: command first appeared in
147: .Bx 4.4 .