The actual and valid IDs of users and groups are displayed. If the two IDs are the same, only the actual IDs are displayed. If only the user name is specified, the current user ID is displayed.
Syntax
Id [-gGnru] [-- help] [-- version] [user name]
Parameter description:
- -G or -- group: displays the ID of the group to which the user belongs.
- -G or -- groups displays the ID of the additional group to which the user belongs.
- -N or -- name indicates the name of the user, group, or additional group.
- -R or -- real displays the actual ID.
- -U or -- user displays the user ID.
- -Help: displays help.
- -Version: displays the version information.
Instance
Display current user information
# Id // display the current user id
Uid = 0 (root) gid = 0 (root) groups = 0 (root), 1 (bin), 2 (daemon), 3 (sys), 4 (adm ), 6 (disk), 10 (wheel)
Context = root: system_r: unconfined_t
Show user group ID
# Id-g
0
Show IDs of all groups
# Id-g
0 1 2 3 4 5 6 10
Display specified user information
# Id hnlinux