Previous Table of Contents Next

Module 66
id (SV)


The id command displays your user ID, user name, group ID, and group name. Your user ID is the third field of the password file. The system uses this user ID to identify the files you own and other important information about processes you are executing. It converts (maps) your user ID to your user name and vice versa. The group ID works the same as the user ID except it is used for group level identification.

If the effective and real IDs are different, both are displayed. The effective IDs are what the shell environment presently considers your user ID and group ID. The real IDs are the user ID and group ID that you obtained when you originally logged in to the system.


The general format for the id command is as follows.

     id [ -a ]


The following option may be used to control how the jobs command functions.

-a Displays all the groups to which the invoking process belongs. If the real and effective ids are different, both are displayed.


Refer to the who command described in Module 159 and the logname command described in Module 78.


The id command is used to display your user ID and group ID. The user name and group name are also displayed. The utility is useful for checking a user's ID and access privileges from a shell script that requires a certain level of security or logging information. It is also useful to check who has left themselves logged on at an unattended terminal.


In this activity you use the id command to display your user ID, group ID, user name, and group name.

1.  Type id and press Return. Notice the user ID is displayed, followed by the user name enclosed in parentheses. The group ID and group name have the same format.
     cj> id
     uid=101(mylogin) gid=40(tech)
2.  Turn to Module 78 to continue the learning sequence.

Previous Table of Contents Next