id
id linux command cheatsheet by Thamizhiniyan C S
Introduction
The id command is used to print real and effective user and group IDs
Syntax
id [OPTION]... [USER]...
Important Flags
Flag | Description |
---|---|
| Print only the effective group id. |
| Print all Group ID’s. |
| Prints name instead of number. |
| Prints real ID instead of numbers. |
| Prints only the effective user ID. |
| Display help messages and exit. |
| Display the version information and exit. |
Examples
Command | Description |
---|---|
Print the current user's UID and GID. | |
Find the UID of the user named "root". | |
Find the GID of the user named "root". | |
Find the UID and all groups associated with the user "root". | |
Display the UID and all groups a user "root" belongs to. | |
Display the name instead of numbers for GID of "root". | |
Display the name instead of numbers for UID of "root". | |
Display the name instead of numbers for all groups of "root". | |
Display the real GID instead of effective GID of "root". | |
Display the real UID instead of effective UID of "root". | |
Display the real group IDs instead of effective groups of "root". |
Last updated