Forever & AlwaysLINUX COMMAND ATLAS

LINUX COMMAND ATLAS · COMMAND GUIDE

Linux id command

Show user and group IDs for the current user or another account.

GNU Coreutils

Syntax

Command form
id [OPTION]... [USER]

Common options

5 options
OptionWhat it does
-u, --userPrint only the user ID.
-g, --groupPrint only the primary group ID.
-G, --groupsPrint all group IDs.
-n, --nameShow a name instead of a numeric ID; combine with -u, -g or -G.
-r, --realShow the real ID rather than the effective ID.

Usage examples

2 examples

Show user and group IDs for the current user or another account.

id

Print the account name associated with the real user ID.

id -un alice

Notes

Without USER, id reports the current process credentials.