Lionel A. answered 6d
Tutor
5
(2)
RHCSA & RHCE Certified Linux Engineer | 10+ Yrs Federal Experience
# list every group name, one per line
getent group | cut -d: -f1
You can also read the group file in the etc directory, but that file only has local groups. If the machine is joined to AD or LDAP through SSSD, those groups won't be in there. getent goes through the system's name service, so you get both.
# groups for a single user
id username
# who is in wheel (usually how I check sudo access on RHEL)
getent group wheel