English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux id command

Linux Command Manual

The Linux id command is used to display the ID of the user and the ID of the group to which they belong.

The id command displays the actual and effective IDs of the user and the groups to which they belong. If the two IDs are the same, only the actual ID is displayed. If only the user name is specified, the ID of the current user is displayed.

Syntax

id [-gGnru][--help][--version][User Name]

Parameter Description:

  • -g or--group  Display ID of the group the user belongs to.
  • -G or--groups  Display ID of supplementary groups the user belongs to.
  • -n or--name  Display user, group or supplementary group name.
  • -r or--real  Display actual ID.
  • -u or--user  Display user ID.
  • -help  Display help.
  • -version  Display version information.

Online Examples

Display Current User Information

# id //Display 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 User Group IDs

# id -g
0

Display All Group IDs

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

Display User Information

# id hnlinux

Linux Command Manual