Easy Tutorial
❮ Linux Comm Uniq Linux Comm Loadkeys ❯

Linux id Command

Linux Command Manual

The Linux id command is used to display the user's ID and the group IDs they belong to.

id will show the real and effective IDs of the user and their groups. If both IDs are the same, only the real ID is displayed. If a username is specified, the ID of the current user is shown.

Syntax

id [-gGnru][--help][--version][username]

Parameter Description:

Examples

Display current user information

# id // Displays 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

Display the group ID of the user

# id -g
0

Display all group IDs

# id -G
0 1 2 3 4 5 6 10

Display information for a specified user

# id hnlinux

Linux Command Manual

❮ Linux Comm Uniq Linux Comm Loadkeys ❯