Skip to main content

Display current user and group identity.

# To display current user's ID (UID), group ID (GID) and groups to which they belong:
id

# To display the current user identity:
id -un

# To display the current user identity as a number:
id -u

# To display the current primary group identity:
id -gn

# To display the current primary group identity as a number:
id -g

# To display an arbitrary user's ID (UID), group ID (GID) and groups to which they belong:
id <username>