Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

User Commands (g - j) id(1)
NAME
id - Displays the users system identity
SYNOPSIS
id [user]
id -G [-n][user]
id -g [-nr][user]
id -u [-nr][user]
FLAGS
-g Outputs only the effective group ID by using the printf format "%u\n".
-G Outputs all different group IDs (effective, real, and supplementary) only by using the
printf format "%u\n". If there is more than one distinct group afliation, this ag out-
puts each such afliation by using the printf format %u before the new line is output.
-n Outputs the name in the printf format %s instead of the group ID by using the printf
format %u.
-r Outputs the real ID instead of the effective ID.
-u Outputs the effective user ID only by using the printf format "%u\n".
DESCRIPTION
The id command writes a message containing the user and group IDs and the corresponding
names of the invoking process or the specied user to the standard output le. When effective
names and IDs do not match the real ones, the id command writes both.
If multiple groups are supported (according to the NGROUPS_MAX variable), the supplemen-
tary group afliations of the invoking process are also written.
If the selected user has more than one allowable group membership listed in the group database,
these are written in the same manner as the supplementary groups.
EXAMPLES
To display your user and group IDs, enter:
id
Information similar to the following is displayed:
uid=9259(tom) gid=1000(mcm) groups=0(system),1(daemon),
3(kmem),5(cf), 8(news),20(dumper),28(operator),
1003(engtools),1016(ddts),1052(mailuni), 1059(utils),
1062(lisbon),1065(perf)
RELATED INFORMATION
Commands: logname(1).
Functions: getuid(2).
527188-003 Hewlett-Packard Company 447