Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ id(1) — OSF/1 3.0 αXP

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

logname(1)

newgrp(1)

getuid(2)

setuid(2)

setgid(2)

id(1)  —  Commands

NAME

id − Displays the user’s system identity

SYNOPSIS

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

FLAGS

−GDisplays all groups ids (real, effective, and supplementary) only, as unsigned decimal numbers. 

−gDisplays only the effective group id as an unsigned decimal number. 

−nDisplays user and group names as strings rather than as numbers. 

−rDisplays only the real ID. 

−uDisplays only the effective user ID as an unsigned decimal number. 

−aDisplays user and all group IDs and names if the environment variable CMD_ENV is set to the string svr4. 

DESCRIPTION

The id command writes to standard output a message containing the user and group IDs and corresponding names of the invoking process.  If effective names and IDs do not match the real ones, the id command writes both. 

If user is specified and the invoking process has sufficient privileges, the IDs and names in the message are for user rather than for the invoking process. Effective IDs are assumed identical to real IDs. 

Your real user and group ids are specified in the /etc/passwd file and are your user and group ids on login.  You can change your active group with the newgrp shell command (see sh(1)) if additional groups are specified for you in the /etc/group file. Such groups are called supplementary.

A process can also have an effective user or group id set when a set-user- or set-group-identifier program is executed.  See setuid(2), setgid(2). 

SVID Conformance

When the environment variable CMD_ENV is set to the string svr4, the command syntax and output is compatible with the SVID standard. In particular, the id command with no flags displays the user’s name and id and the real and effective group names and ids.  The −a flag adds any supplementary group names and ids to the display. 

EXAMPLES

To display your user and group IDs, enter:

id

Information is displayed similar to:

uid=200(thomas)  gid=1(staff)

In the case where a user belongs to a supplementary group, information is displayed similar to:

uid=200(thomas) gid=1(staff) groups=0(system)

However, if the environment variable CMD_ENV is set to the string svr4, the command id with no flags does not display any supplementary groups and results in a display similar to:

uid=200(thomas) gid=1(staff)

To display supplementary groups with CMD_ENV set to svr4, use the command id −a. The display is then similar to:

uid=200(thomas) gid=1(staff) groups=1(users),0(system)

RELATED INFORMATION

Commands:  logname(1), newgrp(1). 

Functions:  getuid(2), setuid(2), setgid(2). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026