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/groupfile, 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!
