How to Find UID and GID

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.

The Linux and Unix operating systems use the UID -- user ID -- to identify a particular user. The GID, or group ID, is used to identify a group. Each user will have a single, unique UID and a primary GID. The user can belong to several secondary groups and each secondary group will have a unique GID. The "id" command can be used to show the UID and GIDs for a particular user. The root (super) user can view the UID and GID for any user. If you do not have root privileges, you can only view your own UID and GID.

Advertisement

Step 1

Open a terminal window. The terminal application is usually found in the "Accessories," "Utilities" or "Tools" section of the main "Programs" or "Applications" menu.

Video of the Day

Step 2

Type the command "su" to become the root user. Skip this step if you do not have root user privileges or want to find the UID or GID for your own account.

Advertisement

Step 3

Type the command "id -u " to find the UID for a particular user. Replace "" with the user's Unix or Linux username.

Step 4

Type the command "id -g " to find the primary GID for a particular user. Replace "" with the user's Unix or Linux username.

Advertisement

Advertisement

Step 5

Type the command "id -G " to list all the GIDs for a particular user. Replace "" with the user's Unix or Linux username.

Step 6

Type the command "exit" to close the root user session.

Video of the Day

Advertisement

Advertisement

references