1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man1m / id.1m
blob68d422ef29aac3f50a6b771918e98d88c889046b
1 '\" te
2 .\"  Copyright (c) 1992, X/Open Company Limited  All Rights Reserved  Portions Copyright (c) 2006, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\"  This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH ID 1M "Nov 28, 2006"
11 .SH NAME
12 id \- return user identity
13 .SH SYNOPSIS
14 .LP
15 .nf
16 \fB/usr/bin/id\fR [\fB-p\fR] [\fIuser\fR]
17 .fi
19 .LP
20 .nf
21 \fB/usr/bin/id\fR \fB-a\fR [\fB-p\fR] [\fIuser\fR]
22 .fi
24 .LP
25 .nf
26 \fB/usr/bin/id\fR \fB-G\fR [\fB-n\fR] [\fIuser\fR]
27 .fi
29 .LP
30 .nf
31 \fB/usr/bin/id\fR \fB-g\fR [\fB-nr\fR] [\fIuser\fR]
32 .fi
34 .LP
35 .nf
36 \fB/usr/bin/id\fR \fB-u\fR [\fB-nr\fR] [\fIuser\fR]
37 .fi
39 .LP
40 .nf
41 \fB/usr/xpg4/bin/id\fR [\fB-p\fR] [\fIuser\fR]
42 .fi
44 .LP
45 .nf
46 \fB/usr/xpg4/bin/id\fR \fB-a\fR [\fB-p\fR] [\fIuser\fR]
47 .fi
49 .LP
50 .nf
51 \fB/usr/xpg4/bin/id\fR \fB-G\fR [\fB-n\fR] [\fIuser\fR]
52 .fi
54 .LP
55 .nf
56 \fB/usr/xpg4/bin/id\fR \fB-g\fR [\fB-nr\fR] [\fIuser\fR]
57 .fi
59 .LP
60 .nf
61 \fB/usr/xpg4/bin/id\fR \fB-u\fR [\fB-nr\fR] [\fIuser\fR]
62 .fi
64 .SH DESCRIPTION
65 .sp
66 .LP
67 If no \fIuser\fR operand is provided, the \fBid\fR utility writes the user and
68 group \fBID\fRs and the corresponding user and group names of the invoking
69 process to standard output. If the effective and real \fBID\fRs do not match,
70 both are written. If multiple groups are supported by the underlying system,
71 \fB/usr/xpg4/bin/id\fR also writes the supplementary group affiliations of the
72 invoking process.
73 .sp
74 .LP
75 If a \fIuser\fR operand is provided and the process has the appropriate
76 privileges, the user and group \fBID\fRs of the selected user are written. In
77 this case, effective \fBID\fRs are assumed to be identical to real \fBID\fRs.
78 If the selected user has more than one allowable group membership listed in the
79 group database, \fB/usr/xpg4/bin/id\fR writes them in the same manner as the
80 supplementary groups described in the preceding paragraph.
81 .SS "Formats"
82 .sp
83 .LP
84 The following formats are used when the \fBLC_MESSAGES\fR locale category
85 specifies the "C" locale. In other locales, the strings \fBuid\fR, \fBgid\fR,
86 \fBeuid\fR, \fBegid\fR, and \fBgroups\fR may be replaced with more appropriate
87 strings corresponding to the locale.
88 .sp
89 .in +2
90 .nf
91 "uid=%u(%s) gid=%u(%s)\en" <\fIreal user ID\fR>, <\fIuser-name\fR>,
92     <\fIreal group ID\fR>, <\fIgroup-name\fR>
93 .fi
94 .in -2
95 .sp
97 .sp
98 .LP
99 If the effective and real user \fBID\fRs do not match, the following are
100 inserted immediately before the \fB\en\fR character in the previous format:
102 .in +2
104 " euid=%u(%s)"
106 .in -2
111 with the following arguments added at the end of the argument list:
113 .in +2
115 <\fIeffective user ID\fR>, <\fIeffective user-name\fR>
117 .in -2
122 If the effective and real group \fBID\fRs do not match, the following is
123 inserted directly before the \fB\en\fR character in the format string (and
124 after any addition resulting from the effective and real user \fBID\fRs not
125 matching):
127 .in +2
129 " egid=%u(%s)"
131 .in -2
136 with the following arguments added at the end of the argument list:
138 .in +2
140 <\fIeffectivegroup-ID\fR>, <\fIeffectivegroupname\fR>
142 .in -2
147 If the process has supplementary group affiliations or the selected user is
148 allowed to belong to multiple groups, the first is added directly before the
149 \fBNEWLINE\fR character in the format string:
151 .in +2
153 " groups=%u(%s)"
155 .in -2
160 with the following arguments added at the end of the argument list:
162 .in +2
164 <\fIsupplementary group ID\fR>, <\fIsupplementary group name\fR>
166 .in -2
171 and the necessary number of the following added after that for any remaining
172 supplementary group \fBID\fRs:
174 .in +2
176 ",%u(%s)"
178 .in -2
183 and the necessary number of the following arguments added at the end of the
184 argument list:
186 .in +2
188 <\fIsupplementary group ID\fR>, <\fIsupplementary group name\fR>
190 .in -2
195 If any of the user \fBID\fR, group \fBID\fR, effective user \fBID\fR, effective
196 group \fBID\fR or supplementary/multiple group \fBID\fRs cannot be mapped by
197 the system into printable user or group names, the corresponding (\fB%s\fR) and
198 name argument is omitted from the corresponding format string.
201 When any of the options are specified, the output format is as described under
202 OPTIONS.
203 .SH OPTIONS
206 The following options are supported by both \fB/usr/bin/id\fR and
207 \fB/usr/xpg4/bin/id\fR. The \fB-p\fR and \fB-a\fR options are invalid if
208 specified with any of the \fB-G\fR, \fB-g\fR, or \fB-u\fR options.
210 .ne 2
212 \fB\fB-p\fR\fR
214 .RS 6n
215 Reports additionally the current project membership of the invoking process.
216 The project is reported using the            format:
218 .in +2
220 "projid=%u(%s)"
222 .in -2
225 which is inserted prior to the \fB\n\fR character of the default format
226 described in the \fBFormats\fR section. The arguments
228 .in +2
230 <\fIproject ID\fR>,<\fIproject name\fR>
232 .in -2
235 are appended to the end of the argument list.  If the project \fBID\fR cannot
236 be mapped by the system into a printable project name, the corresponding
237 \fB(%s)\fR and name argument is omitted from the corresponding format string.
241 .ne 2
243 \fB\fB-a\fR\fR
245 .RS 6n
246 Reports user name, user  \fBID\fR and all the groups to which the user belongs.
250 .ne 2
252 \fB\fB-G\fR\fR
254 .RS 6n
255 Outputs all different group \fBID\fRs (effective, real and supplementary) only,
256 using the format \fB"%u\en"\fR. If there is more than one distinct group
257 affiliation, output each such affiliation, using the format \fB" %u"\fR, before
258 the \fBNEWLINE\fR character is output.
262 .ne 2
264 \fB\fB-g\fR\fR
266 .RS 6n
267 Outputs only the effective group \fBID\fR, using the format \fB"%u\en"\fR.
271 .ne 2
273 \fB\fB-n\fR\fR
275 .RS 6n
276 Outputs the name in the format \fB"%s"\fR instead of the numeric \fBID\fR using
277 the format \fB"%u"\fR.
281 .ne 2
283 \fB\fB-r\fR\fR
285 .RS 6n
286 Outputs the real \fBID\fR instead of the effective \fBID\fR.
290 .ne 2
292 \fB\fB-u\fR\fR
294 .RS 6n
295 Outputs only the effective user \fBID\fR, using the format \fB"%u\en"\fR.
298 .SH OPERANDS
301 The following operand is supported:
303 .ne 2
305 \fB\fIuser\fR\fR
307 .RS 8n
308 The user (login) name for which information is to be written.
311 .SH ENVIRONMENT VARIABLES
314 See \fBenviron\fR(5) for descriptions of the following environment variables
315 that affect the execution of \fBid\fR: \fBLANG\fR, \fBLC_ALL\fR,
316 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
317 .SH EXIT STATUS
320 The following exit values are returned:
322 .ne 2
324 \fB\fB0\fR\fR
326 .RS 6n
327 Successful completion.
331 .ne 2
333 \fB\fB>0\fR\fR
335 .RS 6n
336 An error occurred.
339 .SH ATTRIBUTES
342 See \fBattributes\fR(5) for descriptions of the following attributes:
343 .SS "/usr/bin/id"
348 box;
349 c | c
350 l | l .
351 ATTRIBUTE TYPE  ATTRIBUTE VALUE
353 Interface Stability     Stable
356 .SS "/usr/xpg4/bin/id"
361 box;
362 c | c
363 l | l .
364 ATTRIBUTE TYPE  ATTRIBUTE VALUE
366 Interface Stability     Standard
369 .SH SEE ALSO
372 \fBfold\fR(1), \fBlogname\fR(1), \fBwho\fR(1), \fBgetgid\fR(2),
373 \fBgetgroups\fR(2), \fBgetprojid\fR(2), \fBgetuid\fR(2), \fBattributes\fR(5),
374 \fBenviron\fR(5), \fBstandards\fR(5)
375 .SH NOTES
378 Output produced by the \fB-G\fR option and by the default case could
379 potentially produce very long lines on systems that support large numbers of
380 supplementary groups.