About Linux FAQ

Browse More FAQs:

Linux or UNIX which groups do I belong to?

Posted by Vivek Gite [Last updated: January 4, 2007]

Q. How do I find out - Which groups do I belong to?

A. A user can be in any number of groups apart from his/her default group. Groups are created and managed by root user. You cannot edit or modify your ownership. However Linux allows you to view in which groups you are by using the groups command.

Task: Display or print the groups a user is in

Type the whoami command to display your user ID:
$ whoami
Output:
vivek

Type the groups command :

$ groups
Output:

vivek dialout cdrom floppy audio video plugdev

My default group is vivek and I am a member of dialout, cdrom, floppy, audio, video plugdev group.

You can also use id command to print both numeric and name based group id:
$ id
Output:

uid=1000(vivek) gid=1000(vivek) groups=20(dialout), 24(cdrom), 25(floppy), 29(audio), 44(video), 46(plugdev), 1000(vivek)

E-mail    Print    Can't find an answer to your question? Contact us

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Powered by Open source software.