Linux:- id command

Background

In Linux, the id command displays a user’s group names.

 

Output

Here is information offered

Attribute Meaning Sample
uid User ID uid=1002(daniel)
gid Group ID gid=1002(daniel)
groups Groups groups=1002(daniel),10(wheel)

Syntax


id [username]

Sample

Sample-01

Command


id daniel

Output

Image

id.accountLocal.daniel.01.20200503.1101PM.PNG

Textual


>id daniel
uid=1002(daniel) gid=1002(daniel) groups=1002(daniel),10(wheel)

Explanation

  1. User Id
    • Sample
      • uid => 1002
      • daniel
  2. Group ID
    •  Sample
      • gid => 1002
      • daniel
  3. Groups
    • Sample
      • 1002 ( daniel)
      • 10 ( wheel)

Sample-02

Command


id dadeniji

Output

Image

id.AccountDomain.dadeniji.02.20200503.1113PM

Textual


>id dadeniji
uid=545260630(dadeniji) gid=545260630(dadeniji) groups=545260630(dadeniji),545260032(domain_admins),545260033(domain_users),545261150(serverAdmin)

Explanation

  1. User Id
    • Sample
      • uid => 545260630
      • dadeniji
  2. Group ID
    •  Sample
      • gid => 545260630
      • dadeniji
  3. Groups
    • Sample
      • 545260630(dadeniji)
      • 545260032(domain_admins)
      • 545260033(domain_users)
      • 545261150(serverAdmin)

Summary

The id command offers a straightforward path towards identifying the groups a user has been granted membership privileges.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s