How Do I Delete a Primary Group in Linux?
Contents

How do I change the primary group in Linux?

To change the primary group a user is assigned to, run the usermod command, replacing examplegroup with the name of the group you want to be the primary and exampleusername with the name of the user account. Note the -g here. When you use a lowercase g, you assign a primary group.

Does Userdel Remove group?

If set to yes, userdel will remove the user’s group if it contains no more members, and useradd will create by default a group with the name of the user.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest