Get Group Info

It is never good if we do not have a way to query group info from an existing system. This section guides you through on how to get group information.

Get Group Information

There are 2 ways to get the group information.

List All Groups

In this case, you can list all the groups available in the system. The command is:

$ getent group

Depending on execution permission, this will return not just the user created groups but also system level groups like printers or daemons. Also, you notice that each users is also a group for easier user-level organizations. The return value can be:

libvirt-qemu:x:64055:libvirt-qemu,u0

This is interpreted as:

  • group name = libvirt-qemu
  • password field = x
  • group ID = 64055
  • users in group = libvirt-qemu, u0

Get Specific Group

In this case, you can get specific group from the list query. The command is:

$ getent group | grep <group name>

This will query the specific group name from the list.

That's all for querying group info from users and groups.