iddisplay user and group names |
Command |
id
[user]
id
-G
[-n
]
[user]
id
-g
[-nr
]
[user]
id
-u
[-nr
]
[user]
id
without arguments displays the user name and
group affiliations of the person who issues the command. Specifying a
user argument on the command line displays the same information for the
given user instead of the person invoking id
. In this case,
you require appropriate permissions (on POSIX-conforming systems).
The output has the format
where runum is the user's real user ID number, username is the user's real user name, rgnum is the user's real group ID number, and groupname is the user's real group name. On POSIX-conforming systems, a user's real and effective IDs may differ. In this case, there may be separate entries for effective user ID with the formatuid=runum(username)_gid=rgnum(groupname)
where eunum is the effective user ID number and euname is the effective user name. An entry for effective group ID has the formateuid=eunum(euname)
where egnum is the effective group ID number and egname is the effective group name.egid=egnum(egname)
-G
-g
-n
-G
, -g
, or
-u
, displays the name rather than number.-r
-g
or -u
, displays the real
ID rather than the effective one.-u
/etc/group
On UNIX and POSIX-conforming systems, this contains the group affiliations of each user.
/etc/passwd
On UNIX and POSIX-conforming systems, this file contains the userid, name, and password of each user.
0
Successful completion.
1
Invalid user specified with the -u
option.
2
Failure due to an invalid command line argument.
logname