Linux Command - id

id - display current user and group identity.

Syntax

1
id [OPTION] [USERNAME]

Options

Option Description
-g print only the effective group ID
-G print all group IDs
-u print only effective user ID

Example

Display current user info and group info

1
id

Display current user id as a number

1
id -u

Display current user’s group as a number

1
id -u

Reference