{
    "content": [
        {
            "type": "text",
            "text": "# delgroup (man)\n\n## NAME\n\ndeluser, delgroup - remove a user or group from the system\n\n## SYNOPSIS\n\ndeluser [options] [--force] [--remove-home] [--remove-all-files] [--backup] [--backup-to DIR]\nuser\ndeluser --group [options] group\ndelgroup [options] [--only-if-empty] group\ndeluser [options] user group\nCOMMON OPTIONS\n[--quiet] [--system] [--help] [--version] [--conf FILE]\n\n## DESCRIPTION\n\ndeluser and delgroup remove users and groups from the system according to  command  line  op‐\ntions  and  configuration  information  in /etc/deluser.conf and /etc/adduser.conf.  They are\nfriendlier front ends to the userdel and groupdel programs, removing the  home  directory  as\noption  or  even  all  files  on the system owned by the user to be removed, running a custom\nscript, and other features.  deluser and delgroup can be run in one of three modes:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (3 subsections)\n- **OPTIONS** (10 subsections)\n- **RETURN VALUE**\n- **FILES**\n- **SEE ALSO**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "delgroup",
        "section": "",
        "mode": "man",
        "summary": "deluser, delgroup - remove a user or group from the system",
        "synopsis": "deluser [options] [--force] [--remove-home] [--remove-all-files] [--backup] [--backup-to DIR]\nuser\ndeluser --group [options] group\ndelgroup [options] [--only-if-empty] group\ndeluser [options] user group\nCOMMON OPTIONS\n[--quiet] [--system] [--help] [--version] [--conf FILE]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "",
                "long": "--conf",
                "arg": "FILE",
                "description": "Use FILE instead of the default files /etc/deluser.conf and /etc/adduser.conf"
            },
            {
                "flag": "",
                "long": "--group",
                "arg": null,
                "description": "Remove a group. This is the default action if the program is invoked as delgroup. --help Display brief instructions."
            },
            {
                "flag": "",
                "long": "--quiet",
                "arg": null,
                "description": "Suppress progress messages."
            },
            {
                "flag": "",
                "long": "--system",
                "arg": null,
                "description": "Only delete if user/group is a system user/group. This avoids accidentally deleting non-system users/groups. Additionally, if the user does not exist, no error value is returned. This option is mainly for use in Debian package maintainer scripts."
            },
            {
                "flag": "",
                "long": "--only-if-empty",
                "arg": null,
                "description": "Only remove if no members are left."
            },
            {
                "flag": "",
                "long": "--backup",
                "arg": null,
                "description": "Backup all files contained in the userhome and the mailspool-file to a file named /$user.tar.bz2 or /$user.tar.gz."
            },
            {
                "flag": "",
                "long": "--backup-to",
                "arg": null,
                "description": "Place the backup files not in / but in the directory specified by this parameter. This implicitly sets --backup also."
            },
            {
                "flag": "",
                "long": "--remove-home",
                "arg": null,
                "description": "Remove the home directory of the user and its mailspool. If --backup is specified, the files are deleted after having performed the backup."
            },
            {
                "flag": "",
                "long": "--remove-all-files",
                "arg": null,
                "description": "Remove all files from the system owned by this user. Note: --remove-home does not have an effect any more. If --backup is specified, the files are deleted after having per‐ formed the backup."
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "Display version and copyright information."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "adduser",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/adduser/8/json"
            },
            {
                "name": "deluser.conf",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/deluser.conf/5/json"
            },
            {
                "name": "groupdel",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/groupdel/8/json"
            },
            {
                "name": "userdel",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/userdel/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": [
                    {
                        "name": "Remove a normal user",
                        "lines": 25
                    },
                    {
                        "name": "Remove a group",
                        "lines": 8
                    },
                    {
                        "name": "Remove a user from a specific group",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "--conf FILE",
                        "lines": 2,
                        "long": "--conf",
                        "arg": "FILE"
                    },
                    {
                        "name": "--group",
                        "lines": 4,
                        "long": "--group"
                    },
                    {
                        "name": "--quiet",
                        "lines": 2,
                        "long": "--quiet"
                    },
                    {
                        "name": "--system",
                        "lines": 4,
                        "long": "--system"
                    },
                    {
                        "name": "--only-if-empty",
                        "lines": 2,
                        "long": "--only-if-empty"
                    },
                    {
                        "name": "--backup",
                        "lines": 3,
                        "long": "--backup"
                    },
                    {
                        "name": "--backup-to",
                        "lines": 3,
                        "long": "--backup-to"
                    },
                    {
                        "name": "--remove-home",
                        "lines": 3,
                        "long": "--remove-home"
                    },
                    {
                        "name": "--remove-all-files",
                        "lines": 4,
                        "long": "--remove-all-files"
                    },
                    {
                        "name": "--version",
                        "lines": 2,
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "RETURN VALUE",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 10,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "deluser, delgroup - remove a user or group from the system\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "deluser [options] [--force] [--remove-home] [--remove-all-files] [--backup] [--backup-to DIR]\nuser\n\ndeluser --group [options] group\ndelgroup [options] [--only-if-empty] group\n\ndeluser [options] user group\n\nCOMMON OPTIONS\n[--quiet] [--system] [--help] [--version] [--conf FILE]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "deluser and delgroup remove users and groups from the system according to  command  line  op‐\ntions  and  configuration  information  in /etc/deluser.conf and /etc/adduser.conf.  They are\nfriendlier front ends to the userdel and groupdel programs, removing the  home  directory  as\noption  or  even  all  files  on the system owned by the user to be removed, running a custom\nscript, and other features.  deluser and delgroup can be run in one of three modes:\n",
                "subsections": [
                    {
                        "name": "Remove a normal user",
                        "content": "If called with one non-option argument and without the --group option, deluser will remove  a\nnormal user.\n\nBy  default, deluser will remove the user without removing the home directory, the mail spool\nor any other files on the system owned by the user. Removing  the  home  directory  and  mail\nspool can be achieved using the --remove-home option.\n\nThe --remove-all-files option removes all files on the system owned by the user. Note that if\nyou activate both options --remove-home will have no effect because all files  including  the\nhome directory and mail spool are already covered by the --remove-all-files option.\n\nIf  you  want  to  backup all files before deleting them you can activate the --backup option\nwhich will create a file username.tar(.gz|.bz2) in the directory specified by the --backup-to\noption  (defaulting to the current working directory). Both the remove and backup options can\nalso  be  activated  for  default  in   the   configuration   file   /etc/deluser.conf.   See\ndeluser.conf(5) for details.\n\nIf you want to remove the root account (uid 0), then use the --force parameter; this may pre‐\nvent to remove the root user by accident.\n\nIf the file /usr/local/sbin/deluser.local exists, it will be executed after the user  account\nhas been removed in order to do any local cleanup. The arguments passed to deluser.local are:\nusername uid gid home-directory\n\n"
                    },
                    {
                        "name": "Remove a group",
                        "content": "If deluser is called with the --group option, or delgroup is called, a group will be removed.\n\nWarning: The primary group of an existing user cannot be removed.\n\nIf  the  option  --only-if-empty  is  given, the group won't be removed if it has any members\nleft.\n\n"
                    },
                    {
                        "name": "Remove a user from a specific group",
                        "content": "If called with two non-option arguments, deluser will remove a user from a specific group.\n"
                    }
                ]
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "--conf FILE",
                        "content": "Use FILE instead of the default files /etc/deluser.conf and /etc/adduser.conf\n",
                        "long": "--conf",
                        "arg": "FILE"
                    },
                    {
                        "name": "--group",
                        "content": "Remove a group. This is the default action if the program is invoked as delgroup.\n\n--help Display brief instructions.\n",
                        "long": "--group"
                    },
                    {
                        "name": "--quiet",
                        "content": "Suppress progress messages.\n",
                        "long": "--quiet"
                    },
                    {
                        "name": "--system",
                        "content": "Only delete if user/group is a system user/group. This  avoids  accidentally  deleting\nnon-system  users/groups.  Additionally, if the user does not exist, no error value is\nreturned. This option is mainly for use in Debian package maintainer scripts.\n",
                        "long": "--system"
                    },
                    {
                        "name": "--only-if-empty",
                        "content": "Only remove if no members are left.\n",
                        "long": "--only-if-empty"
                    },
                    {
                        "name": "--backup",
                        "content": "Backup all files contained in the userhome and the  mailspool-file  to  a  file  named\n/$user.tar.bz2 or /$user.tar.gz.\n",
                        "long": "--backup"
                    },
                    {
                        "name": "--backup-to",
                        "content": "Place the backup files not in / but in the directory specified by this parameter. This\nimplicitly sets --backup also.\n",
                        "long": "--backup-to"
                    },
                    {
                        "name": "--remove-home",
                        "content": "Remove the home directory of the user and its mailspool. If --backup is specified, the\nfiles are deleted after having performed the backup.\n",
                        "long": "--remove-home"
                    },
                    {
                        "name": "--remove-all-files",
                        "content": "Remove all files from the system owned by this user. Note: --remove-home does not have\nan effect any more. If --backup is specified, the files are deleted after having  per‐\nformed the backup.\n",
                        "long": "--remove-all-files"
                    },
                    {
                        "name": "--version",
                        "content": "Display version and copyright information.\n",
                        "long": "--version"
                    }
                ]
            },
            "RETURN VALUE": {
                "content": "0      The action was successfully executed.\n\n1      The user to delete was not a system account. No action was performed.\n\n2      There is no such user. No action was performed.\n\n3      There is no such group. No action was performed.\n\n4      Internal error. No action was performed.\n\n5      The group to delete is not empty. No action was performed.\n\n6      The user does not belong to the specified group. No action was performed.\n\n7      You cannot remove a user from its primary group. No action was performed.\n\n8      The required perl-package 'perl modules' is not installed. This package is required to\nperform the requested actions. No action was performed.\n\n9      For removing the root account the parameter \"--force\" is required. No action was  per‐\nformed.\n\n",
                "subsections": []
            },
            "FILES": {
                "content": "/etc/deluser.conf Default configuration file for deluser and delgroup\n\n/usr/local/sbin/deluser.local\nOptional custom add-ons.\n\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "adduser(8), deluser.conf(5), groupdel(8), userdel(8)\n\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright  (C)  2000  Roland  Bauerschmidt.  Modifications (C) 2004 Marc Haber and Joerg Hoh.\nThis manpage and the deluser program are based on adduser which is:\nCopyright (C) 1997, 1998, 1999 Guy Maor.\nCopyright (C) 1995 Ted Hajek, with a great deal borrowed from the original Debian adduser\nCopyright (C) 1994 Ian Murdock.  deluser is free software; see the GNU General Public Licence\nversion 2 or later for copying conditions.  There is no warranty.\n\n\n\nDebian GNU/Linux                        Version 3.118ubuntu5                              DELUSER(8)",
                "subsections": []
            }
        }
    }
}