If you’re a student or new user looking for a Linux system to start learning on, the easiest place to start is on Ubuntu Linux OS. It’s a great Linux operating system for beginners. Ubuntu is an open-source Linux operating system that runs on desktops, laptops, servers, and other devices. Both Ubuntu and Windows systems allow you to be productive, easy to use, and reliable and enable you to install and run thousands of programs from gaming to productivity suite software for individuals and businesses. This post shows you how to perform the basic task of listing groups on Ubuntu Linux. Linux Groups: There are two types of groups users can be assigned to One is a primary and the other is a second group that grants privileges to users to access certain resources. Below is how a typical Linux user account is added and assigned group memberships: User — A user who has an account must belong to one primary group. Typically, the user’s primary group is also named after the user account name.Primary Group — The primary group is created at the same time the user account is created and the user is automatically added to it. The file created by the user automatically belongs to the user group.Secondary Group — This group is not required and is only there to give users access to other resources they don’t already have access to. Users can belong to one or as many secondary groups are possible. The primary user’s group is stored in the /etc/passwd file and the supplementary groups, if any, are listed in the /etc/group file. List User Groups using the group’s command Now that you know the types of groups for users, you can use the groups command to find the groups a user belongs to. Running the groups command without any arguments will list all the groups the user belongs to. example: Should output all the groups the account richard belongs to. The first group with the same name as the user account name is the primary group. To list all the groups a user belongs, add the username to the group’s command example: This should output the same as above List User Groups using the id command One can also use the id command to list group information about the specified user. It prints user and group information for the specified USER, The command will show the username (uid), the user’s primary group (gid), and the user’s secondary groups (groups) Should output the line below: List Group Membership using the getent command If you want to know who are members of a particular group, use the getent command. This command gets entries from the administrative database. To get a membership of the cdrom group, run the command below This should output all the users who have access to the cdrom group. Listing All Groups To list the entire groups on Ubuntu, run the command below That should output all the groups on each line That’s it Congratulations! You have learned how to list groups on Ubuntu Linux.