id(1)

id(1)

NAME

id - print user and group IDs and names

SYNOPSIS

id [-u-g-G][-nr][-P] [user]

DESCRIPTION

The id command writes a message to standard output, giving the user and group IDs and names for the process. If the effective and real IDs are different, both are printed.

If the process has supplementary group af®liations (see groups(1)), the supplementary group af®liations are also written.

If the user operand is speci®ed, and the effective user ID of the process is superuser, the user and group IDs of the selected user are written. In this case, effective IDs are assumed to be identical to real IDs.

Options

The following options modify the behavior described above.

-gDisplay only the group ID. The default is the effective group ID; to modify, use the -roption. If the process has supplementary group af®liations that are different from the effective group ID (or the real ID if the -roption is used), display each such af®liation on the same line. The default is decimal format; to modify, use the -noption.

-GOutput all different group IDs (effective, real, and supplementary) only, using the format "%u\n". If there is more than one distinct group af®liation, output each such af®liation, using the format " %u", before the <newline> is output.

-nWith A -u, -g, or -G, display the ID name instead of the ID number. -rWith -u, -g, or -G, display the real ID instead of the effective ID.

-uDisplay only the user ID. The default is the effective user ID; to modify, use the -roption. The default is decimal format; to modify, use the -noption.

-PDisplay the process resource group ID. See HP Process Resource Manager in DEPENDENCIES.

EXAMPLES

To display the current user and group data:

id

produces:

uid=1834(allanp) gid=20(users)

To display the group ID number for the current process:

id -g

produces:

20

To display the group name for the current process:

id -gn

produces:

users

To display the user and group data for another user:

id ralford

produces:

uid=329(ralford) gid=20(users)

if the effective user ID of the process is superuser. Otherwise, it produces the data for the invoking pro- cess.

i

HP-UX Release 11i: December 2000

− 1 −

Section 1349