Show IDs and groups for the current user.
idShow user and group IDs for the current user or another account.
id [OPTION]... [USER]Show IDs and groups for the current user.
idPrint the account name associated with the real user ID.
id -un alice| Option / clause | Description |
|---|---|
-u, --user | Print only the user ID. |
-g, --group | Print only the primary group ID. |
-G, --groups | Print all group IDs. |
-n, --name | Show a name instead of a numeric ID; combine with -u, -g or -G. |
-r, --real | Show the real ID rather than the effective ID. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.