xref: /original-bsd/usr.bin/id/id.1 (revision 4e9e9871)
1.\" Copyright (c) 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" the Institute of Electrical and Electronics Engineers, Inc.
6.\"
7.\" %sccs.include.redist.roff%
8.\"
9.\"	@(#)id.1	5.1 (Berkeley) 06/29/91
10.\"
11.Dd ""
12.Dt ID 1
13.UC
14.Sh NAME
15.Nm id
16.Nd return user identity
17.Sh SYNOPSIS
18.Nm id
19.Op Ar user
20.Nm id
21.Fl G Op Fl n
22.Op Ar user
23.Nm id
24.Fl g Op Fl nr
25.Op Ar user
26.Nm id
27.Fl u Op Fl nr
28.Op Ar user
29.Sh DESCRIPTION
30The
31.Nm id
32utility displays the user and group names and numeric IDs, of the
33calling process, to the standard output.
34If the real and effective IDs are different both are displayed,
35otherwise only the real ID is displayed.
36.Pp
37If a
38.Ar user
39(login name or user ID)
40is specified, the user and group IDs of that user are displayed.
41In this case, the real and effective IDs are assumed to be the same.
42.Pp
43The options are as follows:
44.Bl -tag -width Ds
45.It Fl G
46Display all of the different group IDs (effective, real and supplementary)
47as white-space separated numbers.
48.It Fl g
49Display only the effective group ID as a number.
50.It Fl n
51Display the name of the user or group ID instead of the number.
52.It Fl r
53Display the real ID instead of the effective ID.
54.It Fl u
55Display only the effective user ID as a number.
56.El
57.Pp
58If any of the ID numbers cannot be mapped into names, the number is displayed
59instead.
60.Pp
61The
62historic
63.Xr groups 1
64command is equivalent to:
65.Nm id Fl Gn Op Ar user .
66.Pp
67The
68.Nm id
69utility exits 0 on success, and >0 if an error occurs.
70.Sh SEE ALSO
71.Xr groups 1 ,
72.Xr who 1 ,
73.Xr whoami 1
74.Sh STANDARDS
75The
76.Nm logname
77function is expected to conform to
78.St -p1003.2 .
79.Sh HISTORY
80The
81.Nm
82command is
83.Ud .
84