To add a new group in Linux, you can use the groupadd command. Here’s how to do it:
-
Open a 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:
getent group groupname
If the group was created, you should see output similar to:
groupname:x:1001:
Make sure you have administrative privileges to create a new group.
