ID Command

HSI Version: 

3.4

Purpose: 

Display current login identity (initial login, "su" login, or "sudo" login)

Aliases: 

 

Command Format: 

 id [-u | -G | -g [-n]] [user]

Options: 

 -G  : if specified, causes group list for current ID to be displayed

 -g  : if specified, causes group ID to be displayed
 -u  : if specified, causes user ID to be displayed
-n  : if specified, causes -g or -u option to display names instead of numbers
 If [user] is specified, causes info to be displayed for the specified
 user. If not specified, info for the current login or SU identity is
 displayed.
 

Keywords: 

 

Usage Notes: 

Only one of the -G, -g and -u options may be specified.
The -G option applies only to the current login or SU/SUDO identity.
If no options are specified, the current login name and id, group name and id,
and group list are displayed in the form:


 uid=123(name) gid=123(name) groups=123(name)[, 234(name) ...]

Example: 

1. List current identity info
? id
uid=500(gleicher) gid=302(gleicher)302302(gleicher) 300(hpss)
											

2. 

List current login user ID
? id -u
											500

3. 

List current login group ID
? id -g 302

4. List current login group name
? id -ng gleicher

Related Command(s): 

SU, SUDO, WHOAMI