kazmax - Linux で自宅サーバー

Delete Linux group - groupdel

To delete a group from Linux, use the command groupdel. There is no option.

If the group to be deleted is the initial group of one of the users, you can not delete the group.

The files changed by the groupdel command are two files "/etc/group" and "/etc/gshadow". Also, "groupdel" command needs to be executed with "root" account.

Last Update : 2018年12月27日

Delete Linux group - groupdel Contents

  1. Delete the group with "groupdel" command.
  2. About "groupdel" command options, and related files.

1. Delete the group with "groupdel" command.

The groupdel command can not delete the user's initial group.

To delete a group with the groupdel command, use the command as follows.

Usage

groupdel group_name

group_name is the group name to be deleted.

Example) When deleting bar_group.

[root@localhost ~]# groupdel bar_group

2. About "groupdel" command options, and related files.

OPTIONS

There is no option of the groupdel command.

Related files

The groupdel command changes two files,

  • /etc/group
  • /etc/gshadow

Even if you delete the group line directly from these files without using the command, you can let the system know that the group has been deleted.