commands.sh

id

all

Display current user and group identity. See also: `logname`.

More info →

Options (5)

boolean

Display the current user identity

Example: id {{[-un|--user --name]}}
-u, --userboolean

Display the current user identity as a number

Example: id {{[-u|--user]}}
boolean

Display the current primary group identity

Example: id {{[-gn|--group --name]}}
-g, --groupboolean

Display the current primary group identity as a number

Example: id {{[-g|--group]}}
boolean

Display all groups the current user belongs to

Example: id {{[-Gn|--groups --name]}}

Examples (8)

Display current user's ID (UID), group ID (GID), and groups to which they belong

Display the current user identity

id [-un|--user --name]

Display the current user identity as a number

id [-u|--user]

Display the current primary group identity

id [-gn|--group --name]

Display the current primary group identity as a number

id [-g|--group]

Display all groups the current user belongs to

id [-Gn|--groups --name]

Display an arbitrary user's ID (UID), group ID (GID), and groups to which they belong

id username

Skip name lookup and specify the UID number explicitly

id +uid_number
made by @shridhargupta | data from tldr-pages