To create a new user group in Linux, you can use the groupadd command. Here’s how to do it:
-
Open your terminal.
-
Use the following command to create a new group. Replace
groupnamewith the desired name of your group:sudo groupadd groupname -
To verify that the group was created successfully, you can use the following command:
getent group groupname
If the group was created, you should see output similar to this:
groupname:x:1001:
Make sure you have administrative privileges to create a new group. If the group already exists, the command will display an error message.
