]>
Commit | Line | Data |
---|---|---|
1 | .\" $NetBSD: id.1,v 1.7 1997/10/19 02:45:47 lukem Exp $ | |
2 | .\" | |
3 | .\" Copyright (c) 1991, 1993, 1994 | |
4 | .\" The Regents of the University of California. All rights reserved. | |
5 | .\" | |
6 | .\" This code is derived from software contributed to Berkeley by | |
7 | .\" the Institute of Electrical and Electronics Engineers, Inc. | |
8 | .\" | |
9 | .\" Redistribution and use in source and binary forms, with or without | |
10 | .\" modification, are permitted provided that the following conditions | |
11 | .\" are met: | |
12 | .\" 1. Redistributions of source code must retain the above copyright | |
13 | .\" notice, this list of conditions and the following disclaimer. | |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
15 | .\" notice, this list of conditions and the following disclaimer in the | |
16 | .\" documentation and/or other materials provided with the distribution. | |
17 | .\" 3. All advertising materials mentioning features or use of this software | |
18 | .\" must display the following acknowledgement: | |
19 | .\" This product includes software developed by the University of | |
20 | .\" California, Berkeley and its contributors. | |
21 | .\" 4. Neither the name of the University nor the names of its contributors | |
22 | .\" may be used to endorse or promote products derived from this software | |
23 | .\" without specific prior written permission. | |
24 | .\" | |
25 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
26 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
27 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
28 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
29 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
30 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
31 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
32 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
33 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
34 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
35 | .\" SUCH DAMAGE. | |
36 | .\" | |
37 | .\" @(#)id.1 8.2 (Berkeley) 5/5/94 | |
38 | .\" | |
39 | .Dd May 5, 1994 | |
40 | .Dt ID 1 | |
41 | .Os BSD 4.4 | |
42 | .Sh NAME | |
43 | .Nm id | |
44 | .Nd return user identity | |
45 | .Sh SYNOPSIS | |
46 | .Nm | |
47 | .Op Ar user | |
48 | .Nm "" | |
49 | .Fl G Op Fl n | |
50 | .Op Ar user | |
51 | .Nm "" | |
52 | .Fl g Op Fl nr | |
53 | .Op Ar user | |
54 | .Nm "" | |
55 | .Fl p | |
56 | .Nm "" | |
57 | .Fl u Op Fl nr | |
58 | .Op Ar user | |
59 | .Sh DESCRIPTION | |
60 | The | |
61 | .Nm | |
62 | utility displays the user and group names and numeric IDs, of the | |
63 | calling process, to the standard output. | |
64 | If the real and effective IDs are different, both are displayed, | |
65 | otherwise only the real ID is displayed. | |
66 | .Pp | |
67 | If a | |
68 | .Ar user | |
69 | (login name or user ID) | |
70 | is specified, the user and group IDs of that user are displayed. | |
71 | In this case, the real and effective IDs are assumed to be the same. | |
72 | .Pp | |
73 | The options are as follows: | |
74 | .Bl -tag -width Ds | |
75 | .It Fl G | |
76 | Display the different group IDs (effective, real and supplementary) | |
77 | as white-space separated numbers, in no particular order. | |
78 | .It Fl g | |
79 | Display the effective group ID as a number. | |
80 | .It Fl n | |
81 | Display the name of the user or group ID for the | |
82 | .Fl G , | |
83 | .Fl g | |
84 | and | |
85 | .Fl u | |
86 | options instead of the number. | |
87 | If any of the ID numbers cannot be mapped into names, the number will be | |
88 | displayed as usual. | |
89 | .It Fl p | |
90 | Make the output human-readable. | |
91 | If the user name returned by | |
92 | .Xr getlogin 2 | |
93 | is different from the login name referenced by the user ID, the name | |
94 | returned by | |
95 | .Xr getlogin 2 | |
96 | is displayed, preceded by the keyword ``login''. | |
97 | The user ID as a name is displayed, preceded by the keyword ``uid''. | |
98 | If the effective user ID is different from the real user ID, the real user | |
99 | ID is displayed as a name, preceded by the keyword ``euid''. | |
100 | If the effective group ID is different from the real group ID, the real group | |
101 | ID is displayed as a name, preceded by the keyword ``rgid''. | |
102 | The list of groups to which the user belongs is then displayed as names, | |
103 | preceded by the keyword ``groups''. | |
104 | Each display is on a separate line. | |
105 | .It Fl r | |
106 | Display the real ID for the | |
107 | .Fl g | |
108 | and | |
109 | .Fl u | |
110 | options instead of the effective ID. | |
111 | .It Fl u | |
112 | Display the effective user ID as a number. | |
113 | .El | |
114 | .Pp | |
115 | The | |
116 | .Nm | |
117 | utility exits 0 on success, and >0 if an error occurs. | |
118 | .Sh SEE ALSO | |
119 | .Xr who 1 | |
120 | .Sh STANDARDS | |
121 | The | |
122 | .Nm | |
123 | function is expected to conform to | |
124 | .St -p1003.2 . | |
125 | .Sh HISTORY | |
126 | The | |
127 | historic | |
128 | .Xr groups 1 | |
129 | command is equivalent to | |
130 | .Dq Nm id Fl Gn Op Ar user . | |
131 | .Pp | |
132 | The | |
133 | historic | |
134 | .Xr whoami 1 | |
135 | command is equivalent to | |
136 | .Dq Nm id Fl un . | |
137 | .Pp | |
138 | The | |
139 | .Nm | |
140 | command first appeared in | |
141 | .Bx 4.4 . |