The Wayback Machine - https://web.archive.org/web/20231013182041/https://www.geeksforgeeks.org/groupdel-command-in-linux-with-examples/
Open In App
Related Articles

groupdel command in Linux with examples

Improve Article
Improve
Save Article
Save
Like Article
Like

groupdel command is used to delete a existing group. It will delete all entry that refers to the group, modifies the system account files, and it is handled by superuser or root user. Syntax:

groupdel [options] GROUP

Files:

  • /etc/group : It contains the account information of the Group.
  • /etc/gshadow : It contains the secure group account information.

Exit values: This command exists with the following values.

  • 0: Success
  • 2: Invalid Command Syntax.
  • 6: Specified group doesn’t exist.
  • 8: Can’t remove users primary group.
  • 10: Can’t update group file.

Options:

  • -f –force: It used to delete a group even if it is the primary group of a user.
  • -h –help: It displays the help message and exit.
  • -R –root: It apply the changes in the CHROOT_DIR directory. Also, it uses the configuration files from the CHROOT_DIR directory.

Last Updated : 29 Dec, 2022
Like Article
Save Article
Similar Reads
Related Tutorials