LinuxCommandLibrary

id

Display 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 the real and effective user ID (UID), primary group ID (GID), and all supplementary group memberships for the specified user or the current user.
The command is commonly used in scripts to check privileges, verify group memberships, and determine access rights. Without arguments, it reports information about the invoking user. With a username argument, it reports on that user instead.

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

Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00
GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95