Introduction
The Linux command line is a powerful tool for managing user accounts and groups. One of the most common tasks is to add a new group to the system. In this tutorial, we will show you how to add a new group with the group name “developers” using the Linux command line. We will also discuss the various options available for managing groups and users.
Examples
sudo groupadd developers
To add a new group with group name “developers” in Linux, use the following command:
sudo groupadd developers
This command will create a new group with the name “developers”. To add users to this group, use the following command:
sudo usermod -a -G developers username
Replace “username” with the actual username of the user you want to add to the group. To verify that the user has been added to the group, use the following command:
groups username
This command will list all the groups the user belongs to. If the “developers” group is listed, then the user has been successfully added to the group.