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)
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 1 comment… read it below or add one }
hi,
I am saeed from Iran I wanna ask you a question:
if a person haven,t access to Internet.how can I join these groups?