The id command is used to display user ID (UID) and group ID (GID) information. Entering the command with no options displays information about the user who is currently logged in. You can also specify a user name as an option to display ID information about a specific user.

id command examples in Linux

Syntax

The syntax of the id command is:

# id [options] [user name]

id Command Examples

1. To print the current user ID:

2. To ge the all the identification information of the a user:

3. To print only the security context of the user:

4. To print only the effective group ID:

5. To print all the group IDs:

6. To print the name instead of number:

7. To print the real ID instead of effective ID:

8. To print only the effective ID:

9. To get the help for ID command:

10. To get the version of the ID command: