Command to create and delete group in Red Hat and CentOS linux

Command to create and delete group in Red Hat and CentOS linux

Question: How to create and delete the group in Linux (Red Hat or CentOS) by using command line
Answer: To create and delete the group in linux,follow the given below steps.

To create new group ,use given below command

Syntax:

groupadd groupname

Example

groupadd accounts

To delete group ,use given below command

Syntax:

groupdel groupname

Example:

groupdel accounts

Note: When you create a new group you will find the entry in /etc/group file.
As per example, we have created a new group called accounts, you can see its entry in /etc/group file.
See the below given screenshot

groupadd

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.