How do I create a new group?

QuestionsQuestions4 SkillsProUser Account CreationNov, 09 2025
0148

Creating a new group in Linux is a straightforward process that can be accomplished using the groupadd command. Here’s how to do it:

Steps to Create a New Group

  1. Open a Terminal: Access your terminal application.

  2. Use the groupadd Command: The basic syntax for creating a new group is:

    sudo groupadd groupname
    

    Replace groupname with the desired name for your new group. For example, to create a group called developers, you would run:

    sudo groupadd developers
    
  3. Verify Group Creation: To confirm that the group has been created successfully, you can use the getent command:

    getent group | grep groupname
    

    For example:

    getent group | grep developers
    

    If the group was created successfully, you should see output similar to:

    developers:x:1002:
    

    Here, developers is the group name, x indicates that the group password is stored in the shadow file, and 1002 is the Group ID (GID).

Example Command

Here’s a complete example of creating a new group called sales:

sudo groupadd sales

Conclusion

Creating a new group is an essential task for managing user permissions and organizing users in a Linux environment. If you have further questions or need clarification, feel free to ask!

0 Comments

no data
Be the first to share your comment!