Group Administration
Group commands follow a similar naming convention to user commands.
Creating a New Group (groupadd)
bash $ sudo groupadd marketing
Deleting a Group (groupdel)
bash $ sudo groupdel temp_group
Modifying a Group (groupmod)
This is primarily used to change the Group Name (-n).
bash
Rename the 'marketing' group to 'sales'
$ sudo groupmod -n sales marketing
Viewing Group Membership
-
groups: Shows the groups the current user belongs to. bash $ groups user_name sudo web_ops -
groups username: Shows the groups for a specific user. -
id: Shows the UID, GID, and all group memberships for a user.