Name

id

Synopsis

    id [options] [username]

Display information about yourself or another user: user ID, group ID, effective user ID and group ID if relevant, and additional group IDs.

Common Options

-g, --group

Print group ID only.

-G, --groups

Print supplementary groups only.

-n, --name

With -u, -g, or -G, print user or group name, not number.

-r, --real

With -u, -g, or -G, print real, not effective, user ID or group ID.

-u, --user

Print user ID only.

Solaris Option

-a

/usr/bin/id: list all groups.

GNU/Linux Options

-a

Ignored; for compatibility with other systems.

-Z, --context

Print the security context. SELinux only.

Mac OS X Option

-P

Print information as an /etc/passwd entry.

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.