How to delete a group from server via commandline – Unix/Linux
What is a group in Linux?
This is a way to organize Linux users. The group membership is administrated by the file “/etc/group” which includes a list of groups and its members. We can also define a user in different groups. In this case that particular user can access files in different groups where it has access.
What’s the command to delete a particular group?
You can add a group by using the command ‘groupadd‘ and also you can manage the same group by using the ‘groupmems’ command. Here is a command to delete the group from system/server.
# groupdel $groupname
Creating a group
[[email protected] ~]# groupadd testgrp [[email protected] ~]# grep testgrp /etc/group testgrp:x:779:
Deleting a group
[[email protected] ~]# groupdel testgrp [[email protected] ~]# grep testgrp /etc/group
That’s it 🙂