Previous Section  < Day Day Up >  Next Section

Recipe 8.3. Finding a User's UID and GID

8.3.1 Problem

You want to know a quick way to check the UIDs of users and see what groups they belong to.

8.3.2 Solution

Use the id command:

$ id carla

uid=1000(carla) gid=1000(carla) groups=1000(carla),20(dialout),24(cdrom),25(floppy),

29(audio),30(dip),44(video), 105(windows),432(usb),1001(cdrecording)

8.3.3 Discussion

id has a few options:


-u

Show the UID only.


-g

Show the GID only.


-gn

Show the user's primary group name, instead of the GID.

8.3.4 See Also

  • id(1)

    Previous Section  < Day Day Up >  Next Section