id(1) id(1)
NAME
id - print user and group IDs and names
SYNOPSIS
id [option ...] [username]
DESCRIPTION
id writes the following on the standard output for the invoking pro-
cess:
- the user ID (UID)
- the login name
- the group ID (GID)
- the group name.
If the effective and real IDs/names are not identical, both are
printed.
Interaction with su
id reports information on the current login name. Thus, if you enter
id after using the su command to switch login names (i.e. become
another user), id will print information on your new name.
The who and who am i commands, by contrast, always return information
on the name under which you originally logged in.
OPTIONS
The options -G, -g, and -u cannot be combined.
No option specified
In addition to the ID and login name of the user, id reports all
the groups to which the invoking process belongs and all the
groups to which the invoking user belongs.
This is equivalent to the old option -a, which will continue to
be supported.
-G id outputs all group numbers.
-g id outputs only the effective group numbers.
-n The corresponding names are output instead of numbers.
-r The real ID is output instead of the effective ID. -r cannot be
combined with -G.
-u id outputs only the effective user numbers.
Page 1 Reliant UNIX 5.44 Printed 11/98
id(1) id(1)
-- If username begins with a dash (-), the end of the command-line
options must be marked with --.
username
id outputs information on the specified user.
EXAMPLES
To check your current user ID, group ID, and their corresponding
names, you enter:
$ id
id might then report the following:
uid=115(phil) gid=1(other)
LOCALE
The LCMESSAGES environment variable governs the language in which
message texts are displayed. If LCMESSAGES is undefined or is defined
as the null string, it defaults to the value of LANG. If LANG is like-
wise undefined or null, the system acts as if it were not internation-
alized.
The LCALL environment variable governs the entire locale. LCALL
takes precedence over all the other environment variables which affect
internationalization.
FILES
/etc/passwd
Password file containing login names and, among other things, the
associated user and group IDs.
/etc/group
Group file containing group names and the associated group IDs
and login names.
SEE ALSO
logname(1), newgrp(1), su(1), who(1), getuid(2).
Page 2 Reliant UNIX 5.44 Printed 11/98