Recipe 8.3. Finding a User s UID and GID

 < Day Day Up > 

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)

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net