Linux id command

Updated: 04/26/2017 by Computer Hope

About id

Prints real and effective user and group IDs.

id syntax

id [OPTION]... [USERNAME]

Description

Print user and group information for the specified USERNAME, or (when USERNAME omitted) for the current user.

Options

-a Ignored; included for compatibility with other versions.
-Z, --context Print only the security context of the current user.
-g, --group Print only the effective group ID.
-G, --groups Print all group IDs.
-n, --name Print a name instead of a number, for -ugG.
-r, --real Print the real ID instead of the effective ID, with -ugG.
-u, --user Print only the effective user ID.
--help Display this help and exit.
--version Output version information and exit.

If no OPTION is specified, id prints general user information.

id examples

id

Reports user and group IDs similar to the example below:

uid=12345(comphope) gid=12(users) 

finger — List information about a user.
logname — Return a user's login name.
who — Report which users are logged in to the system.