Linux: Find Out My Group Name [ Group Memberships ]

To find out your group name (also known as your group membership) in Linux, you can use the following command:

$ groups

This command will list all of the groups that you are a member of. For example, the output of the groups command might look something like this:

myuser adm cdrom sudo dip plugdev lpadmin sambashare

Each group listed is a separate line in the output, and the name of the primary group for the user is listed first.

Alternatively, you can use the id command to display information about the user, including their group membership:

$ id
uid=1000(myuser) gid=1000(myuser) groups=1000(myuser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),124(sambashare)

In this output, the group information is listed in the groups field, and each group is identified by its group ID number (gid) as well as its name.

Leave a Comment