You are here: >

Linux and Unix id command

id commandAbout id
id syntax
id examples
Related commands
Linux and Unix main page

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.