How to add / list / remove a group [duplicate]

Solution 1:

Which group do you belong to:

groups

All existing groups are in the file /etc/group. You would need just the first column of each entry (the fields are separated by colons). Thus:

cut -d: -f1 /etc/group

New groups are defined using

groupadd groupname

Groups are removed using

groupdel groupname