remove support for 'trademark files'
[unleashed/tickless.git] / share / man / man1m / id.1m
blob692d3ae3578873c12ea0543ea45f205af7ec0b07
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 "Aug 14, 2017"
11 .SH NAME
12 id \- return user identity
13 .SH SYNOPSIS
14 .LP
15 .nf
16 \fB/usr/bin/id\fR \fB-G\fR [\fB-n\fR] [\fIuser\fR]
17 .fi
19 .LP
20 .nf
21 \fB/usr/bin/id\fR \fB-g\fR [\fB-nr\fR] [\fIuser\fR]
22 .fi
24 .LP
25 .nf
26 \fB/usr/bin/id\fR [\fB-p\fR] [\fIuser\fR]
27 .fi
29 .LP
30 .nf
31 \fB/usr/bin/id\fR \fB-u\fR [\fB-nr\fR] [\fIuser\fR]
32 .fi
34 .SH DESCRIPTION
35 .LP
36 If no \fIuser\fR operand is provided, the \fBid\fR utility writes the user and
37 group \fBID\fRs and the corresponding user and group names of the invoking
38 process to standard output. It also writes the supplementary group affiliations
39 of the invoking process.
40 .sp
41 .LP
42 If a \fIuser\fR operand is provided and the process has the appropriate
43 privileges, the user and group \fBID\fRs of the selected user are written. In
44 this case, effective \fBID\fRs are assumed to be identical to real \fBID\fRs.
45 .SS "Formats"
46 .LP
47 The following formats are used when the \fBLC_MESSAGES\fR locale category
48 specifies the "C" locale. In other locales, the strings \fBuid\fR, \fBgid\fR,
49 \fBeuid\fR, \fBegid\fR, and \fBgroups\fR may be replaced with more appropriate
50 strings corresponding to the locale.
51 .sp
52 .in +2
53 .nf
54 "uid=%u(%s) gid=%u(%s)\en" <\fIreal user ID\fR>, <\fIuser-name\fR>,
55     <\fIreal group ID\fR>, <\fIgroup-name\fR>
56 .fi
57 .in -2
58 .sp
60 .sp
61 .LP
62 If the effective and real user \fBID\fRs do not match, the following are
63 inserted immediately before the \fB\en\fR character in the previous format:
64 .sp
65 .in +2
66 .nf
67 " euid=%u(%s)"
68 .fi
69 .in -2
70 .sp
72 .sp
73 .LP
74 with the following arguments added at the end of the argument list:
75 .sp
76 .in +2
77 .nf
78 <\fIeffective user ID\fR>, <\fIeffective user-name\fR>
79 .fi
80 .in -2
81 .sp
83 .sp
84 .LP
85 If the effective and real group \fBID\fRs do not match, the following is
86 inserted directly before the \fB\en\fR character in the format string (and
87 after any addition resulting from the effective and real user \fBID\fRs not
88 matching):
89 .sp
90 .in +2
91 .nf
92 " egid=%u(%s)"
93 .fi
94 .in -2
95 .sp
97 .sp
98 .LP
99 with the following arguments added at the end of the argument list:
101 .in +2
103 <\fIeffectivegroup-ID\fR>, <\fIeffectivegroupname\fR>
105 .in -2
110 If the process has supplementary group affiliations or the selected user is
111 allowed to belong to multiple groups, the first is added directly before the
112 \fBNEWLINE\fR character in the format string:
114 .in +2
116 " groups=%u(%s)"
118 .in -2
123 with the following arguments added at the end of the argument list:
125 .in +2
127 <\fIsupplementary group ID\fR>, <\fIsupplementary group name\fR>
129 .in -2
134 and the necessary number of the following added after that for any remaining
135 supplementary group \fBID\fRs:
137 .in +2
139 ",%u(%s)"
141 .in -2
146 and the necessary number of the following arguments added at the end of the
147 argument list:
149 .in +2
151 <\fIsupplementary group ID\fR>, <\fIsupplementary group name\fR>
153 .in -2
158 If any of the user \fBID\fR, group \fBID\fR, effective user \fBID\fR, effective
159 group \fBID\fR or supplementary/multiple group \fBID\fRs cannot be mapped by
160 the system into printable user or group names, the corresponding (\fB%s\fR) and
161 name argument is omitted from the corresponding format string.
164 When any of the options are specified, the output format is as described under
165 OPTIONS.
166 .SH OPTIONS
167 .ne 2
169 \fB\fB-G\fR\fR
171 .RS 6n
172 Outputs all different group \fBID\fRs (effective, real and supplementary) only,
173 using the format \fB"%u\en"\fR. If there is more than one distinct group
174 affiliation, output each such affiliation, using the format \fB" %u"\fR, before
175 the \fBNEWLINE\fR character is output.
179 .ne 2
181 \fB\fB-g\fR\fR
183 .RS 6n
184 Outputs only the effective group \fBID\fR, using the format \fB"%u\en"\fR.
188 .ne 2
190 \fB\fB-n\fR\fR
192 .RS 6n
193 Outputs the name in the format \fB"%s"\fR instead of the numeric \fBID\fR using
194 the format \fB"%u"\fR.
199 The \fB-p\fR option is invalid if
200 specified with any of the \fB-G\fR, \fB-g\fR, or \fB-u\fR options.
202 .ne 2
204 \fB\fB-p\fR\fR
206 .RS 6n
207 Reports additionally the current project membership of the invoking process.
208 The project is reported using the            format:
210 .in +2
212 "projid=%u(%s)"
214 .in -2
217 which is inserted prior to the \fB\en\fR character of the default format
218 described in the \fBFormats\fR section. The arguments
220 .in +2
222 <\fIproject ID\fR>,<\fIproject name\fR>
224 .in -2
227 are appended to the end of the argument list.  If the project \fBID\fR cannot
228 be mapped by the system into a printable project name, the corresponding
229 \fB(%s)\fR and name argument is omitted from the corresponding format string.
233 .ne 2
235 \fB\fB-r\fR\fR
237 .RS 6n
238 Outputs the real \fBID\fR instead of the effective \fBID\fR.
242 .ne 2
244 \fB\fB-u\fR\fR
246 .RS 6n
247 Outputs only the effective user \fBID\fR, using the format \fB"%u\en"\fR.
250 .SH OPERANDS
252 The following operand is supported:
254 .ne 2
256 \fB\fIuser\fR\fR
258 .RS 8n
259 The user (login) name for which information is to be written.
262 .SH ENVIRONMENT VARIABLES
264 See \fBenviron\fR(5) for descriptions of the following environment variables
265 that affect the execution of \fBid\fR: \fBLANG\fR, \fBLC_ALL\fR,
266 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
267 .SH EXIT STATUS
269 The following exit values are returned:
271 .ne 2
273 \fB\fB0\fR\fR
275 .RS 6n
276 Successful completion.
280 .ne 2
282 \fB\fB>0\fR\fR
284 .RS 6n
285 An error occurred.
288 .SH ATTRIBUTES
290 See \fBattributes\fR(5) for descriptions of the following attributes:
291 .SS "/usr/bin/id"
294 box;
295 c | c
296 l | l .
297 ATTRIBUTE TYPE  ATTRIBUTE VALUE
299 Interface Stability     Standard
302 .SH SEE ALSO
304 \fBfold\fR(1), \fBlogname\fR(1), \fBwho\fR(1), \fBgetgid\fR(2),
305 \fBgetgroups\fR(2), \fBgetprojid\fR(2), \fBgetuid\fR(2), \fBattributes\fR(5),
306 \fBenviron\fR(5), \fBstandards\fR(5)
307 .SH NOTES
309 Output produced by the \fB-G\fR option and by the default case could
310 potentially produce very long lines on systems that support large numbers of
311 supplementary groups.