LinuxCommandLibrary

id

displays user and group identity information

TLDR

Show current user info

$ id
copy
Show info for user
$ id [username]
copy
Show only user ID
$ id -u
copy
Show only group ID
$ id -g
copy
Show all group IDs
$ id -G
copy
Show names instead of numbers
$ id -n -u
copy

SYNOPSIS

id [options] [user]

DESCRIPTION

id displays user and group identity information. It shows UID, GID, and supplementary groups for users.
The command is useful for verifying permissions and group memberships. It can query any user or the current user by default.

PARAMETERS

USER

Username to query.
-u, --user
Print user ID only.
-g, --group
Print primary group ID.
-G, --groups
Print all group IDs.
-n, --name
Print names instead of IDs.
-r, --real
Print real ID.
--help
Display help information.

CAVEATS

Part of coreutils. Shows cached info at login. Real vs effective ID support.

HISTORY

id is a standard Unix command, part of GNU coreutils on Linux.

SEE ALSO

whoami(1), groups(1), users(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard