How to list all groups?

QuestionsQuestions8 SkillsProYour First Linux LabSep, 04 2025
0128

To list all groups on a Linux system, you can use the following command:

cat /etc/group

Explanation:

  • This command displays the contents of the /etc/group file, which contains information about all groups on the system.

Alternative Command:

You can also use the getent command:

getent group

Output:

Both commands will show a list of groups, typically formatted as:

group_name:x:GID:user1,user2,...
  • group_name: The name of the group.
  • GID: The group ID.
  • user1,user2,...: Users that are members of the group.

If you have any further questions or need more details, feel free to ask!

0 Comments

no data
Be the first to share your comment!