DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

id(1M)


id -- print the user name and ID, and group name and ID

Synopsis

id [user]
id -G [-n] [user]
id -g [-nr] [user]
id -u [-nr] [user]
id [-a]

Description

id displays information on the calling process's user and group IDs. If user is specified, then information on the user login is displayed instead.

The information displayed is the user ID and name and the group ID and name. If the real and effective user IDs do not match, both are printed. The same is true for real and effective group IDs. If the user belongs to more than one group, the extra groups are also displayed.

The output format is a sequence of equality statements of the form

id-title=numeric-id(name)

each separated by a singlespace. The numeric-id is the numeric representation of the group or user, real or effective ID. The name is the symbolic representation of this ID (the login name of the user, for example). In the C locale, the id-title is one of the following strings.

id-title description
uid user ID
gid group ID
euid effective user ID
egid effective group ID
groups supplementary group IDs

 +---------+-------------------------+
 |id-title | description             |
 +---------+-------------------------+
 |uid      | user ID                 |
 +---------+-------------------------+
 |gid      | group ID                |
 +---------+-------------------------+
 |euid     | effective user ID       |
 +---------+-------------------------+
 |egid     | effective group ID      |
 +---------+-------------------------+
 |groups   | supplementary group IDs |
 +---------+-------------------------+
The equality statements are presented in the order given in the table, with each statement present according to the conditions explained in the first paragraph. However, the groups statement, which is always written last, if at all, is slightly different because each extra supplementary group after the first does not have its own equality statement but adds

,numeric-id(name)

to the end of the output line.

Options


-a
This option does nothing. It is for backward compatibility only, and should not be used.

-G
Display all different (numeric) group IDs (real, effective, and supplementary), each separated by a space.

-g
Display only the effective (numeric) group ID.

-n
Display the name instead of the numeric ID (when used with -G, -g, or %-u).

-r
Display the real ID instead of the effective ID (when used with -g or -u).

-u
Display only the effective (numeric) user ID.

Files


/usr/lib/locale/locale/LC_MESSAGES/uxcore.abi
language-specific message file (See LANG on environ(5))

References

getuid(2)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004