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.

Syntax:

# groupdel $groupname

Example:

Creating a group

[root@localhost ~]# groupadd testgrp
[root@localhost ~]# grep testgrp /etc/group
testgrp:x:779:

Deleting a group

[root@localhost ~]# groupdel testgrp
[root@localhost ~]# grep testgrp /etc/group

That’s it 🙂

Related Links :
groupadd , groupmems, groupmod,

More:
ls, head, tail, top, ps, find, crontab

 

How to give access only to a folder inside s3 bucket for an AWS IAM user?

Sometime, you want this option to limit access to an s3 buckets from a particular IAM user. This can be done by adding custom policy on IAM user without changing any policies from bucket level.

Scenario: You are AWS account owner and you want to give access to one of your web developer to a particular folder on your main s3 bucket. It’s safe to give access in this manner.

You are safe from any type of data changes in all other folders.

Post navigation

Arunlal A

Engineer. Linux enthusiast. Traveller. DevOps learner and practitioner. I enjoy working with Linux, DevOps, automation, and technology while exploring new places along the way. I use this space to share my experiences, learnings, experiments, and things I discover along the journey. Whether you're a seasoned DevOps professional or just getting started, let's connect, learn, and grow together. Happy coding, automating, and deploying!

19 thoughts on “How to delete a group from server via commandline – Unix/Linux”

  1. Thanks man, no bs right to the point, other websites have you skim through a 1000 word page jest to see how to do a simple task I didn’t want to learn all about users and groups I just couldn’t remember the groupdel command, it’s like backwards if you think about it should be delgroup “group you want to delete” but it didn’t work that way hummm lol, thanks again man…

Leave a Reply

Your email address will not be published. Required fields are marked *