I know there is the /etc/group file that lists all users groups.
I would like to know if there is a simple command to list all user group names in spite of parsing the world readable /etc/group file. I am willing to create an administrator web page that lists Linux accounts’ group names.
To list all local groups which have users assigned to them, use this command:
For more info- >
Unix groups,
Cut command,
sort command