System Info

id

Print real and effective user and group IDs.

Synopsis

syntax
id [OPTION]... [USER]

Examples

Show all user and group IDs
id
Print current username
id -un
List all group names for current user
id -Gn
Show IDs for a specific user
id www-data

Common options

FlagDescription
-uPrint only effective user ID
-gPrint only effective group ID
-GPrint all group IDs
-nPrint name instead of number

About id

The `id` command print real and effective user and group IDs. System information commands provide insight into hardware, kernel, memory, disk, and user session details.

These are typically the first tools you reach for when diagnosing system problems, capacity planning, or auditing a server's configuration. They work across most Linux distributions without additional packages.

The command accepts 4 commonly used flags shown above, though the full set of options is available in the man page (`man id`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More System Info Commands

Other commands in the System Info category

Related tools