man > deluser(8)

DELUSER(8) System Manager's Manual DELUSER(8)

๐Ÿ“› NAME

deluser, delgroup - remove a user or group from the system

๐Ÿš€ Quick Reference

Use CaseCommandDescription
Remove a normal user (keep home)deluser userRemoves user account, leaves home directory and mail spool intact.
Remove user and home directorydeluser --remove-home userRemoves user, home directory, and mail spool.
Remove user and all owned filesdeluser --remove-all-files userRemoves user and all files owned by them on the system.
Remove a groupdelgroup groupRemoves the specified group (if empty).
Remove user from a specific groupdeluser user groupRemoves user from the given group.
Remove only if group emptydelgroup --only-if-empty groupPrevents removal if group still has members.

๐Ÿ“‹ SYNOPSIS

deluser [options] [--force] [--remove-home] [--remove-all-files] [--backup] [--backup-to DIR] user
deluser --group [options] group
delgroup [options] [--only-if-empty] group
deluser [options] user group

COMMON OPTIONS

[--quiet] [--system] [--help] [--version] [--conf FILE]

๐Ÿ“– DESCRIPTION

deluser and delgroup remove users and groups from the system according to command line options and configuration information in /etc/deluser.conf and /etc/adduser.conf. They are friendlier front ends to the userdel and groupdel programs, removing the home directory as option or even all files on the system owned by the user to be removed, running a custom script, and other features. deluser and delgroup can be run in one of three modes:

๐Ÿ‘ค Remove a normal user

If called with one non-option argument and without the --group option, deluser will remove a normal user.

By default, deluser will remove the user without removing the home directory, the mail spool or any other files on the system owned by the user. Removing the home directory and mail spool can be achieved using the --remove-home option.

The --remove-all-files option removes all files on the system owned by the user. Note that if you activate both options --remove-home will have no effect because all files including the home directory and mail spool are already covered by the --remove-all-files option.

If you want to backup all files before deleting them you can activate the --backup option which will create a file username.tar(.gz|.bz2) in the directory specified by the --backup-to option (defaulting to the current working directory). Both the remove and backup options can also be activated for default in the configuration file /etc/deluser.conf. See deluser.conf(5) for details.

If you want to remove the root account (uid 0), then use the --force parameter; this may prevent to remove the root user by accident.

If the file /usr/local/sbin/deluser.local exists, it will be executed after the user account has been removed in order to do any local cleanup. The arguments passed to deluser.local are: username uid gid home-directory

๐Ÿ‘ฅ Remove a group

If deluser is called with the --group option, or delgroup is called, a group will be removed.

Warning: The primary group of an existing user cannot be removed.

If the option --only-if-empty is given, the group won't be removed if it has any members left.

๐Ÿ”„ Remove a user from a specific group

If called with two non-option arguments, deluser will remove a user from a specific group.

๐Ÿ”ง OPTIONS

๐Ÿ“„ --conf FILE

Use FILE instead of the default files /etc/deluser.conf and /etc/adduser.conf

๐Ÿ‘ฅ --group

Remove a group. This is the default action if the program is invoked as delgroup.

โ“ --help

Display brief instructions.

๐Ÿ”‡ --quiet

Suppress progress messages.

โš™๏ธ --system

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.

๐Ÿงน --only-if-empty

Only remove if no members are left.

๐Ÿ’พ --backup

Backup all files contained in the userhome and the mailspool-file to a file named /$user.tar.bz2 or /$user.tar.gz.

๐Ÿ“‚ --backup-to

Place the backup files not in / but in the directory specified by this parameter. This implicitly sets --backup also.

๐Ÿ  --remove-home

Remove the home directory of the user and its mailspool. If --backup is specified, the files are deleted after having performed the backup.

๐Ÿ—‘๏ธ --remove-all-files

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 performed the backup.

โ„น๏ธ --version

Display version and copyright information.

๐Ÿšช Exit Codes

๐Ÿ“ FILES

๐Ÿ”— SEE ALSO

adduser(8), deluser.conf(5), groupdel(8), userdel(8)

ยฉ COPYRIGHT

Copyright (C) 2000 Roland Bauerschmidt. Modifications (C) 2004 Marc Haber and Joerg Hoh. This manpage and the deluser program are based on adduser which is: Copyright (C) 1997, 1998, 1999 Guy Maor. Copyright (C) 1995 Ted Hajek, with a great deal borrowed from the original Debian adduser Copyright (C) 1994 Ian Murdock. deluser is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is no warranty.

Debian GNU/Linux   Version 3.118ubuntu5   DELUSER(8)

deluser(8)
๐Ÿ“› NAME ๐Ÿš€ Quick Reference ๐Ÿ“‹ SYNOPSIS ๐Ÿ“– DESCRIPTION
๐Ÿ‘ค Remove a normal user ๐Ÿ‘ฅ Remove a group ๐Ÿ”„ Remove a user from a specific group
๐Ÿ”ง OPTIONS
๐Ÿ“„ --conf FILE ๐Ÿ‘ฅ --group โ“ --help ๐Ÿ”‡ --quiet โš™๏ธ --system ๐Ÿงน --only-if-empty ๐Ÿ’พ --backup ๐Ÿ“‚ --backup-to ๐Ÿ  --remove-home ๐Ÿ—‘๏ธ --remove-all-files โ„น๏ธ --version
๐Ÿšช Exit Codes ๐Ÿ“ FILES ๐Ÿ”— SEE ALSO ยฉ COPYRIGHT

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-12 07:34 @2600:1f28:365:80b0:6f72:a904:73b0:e266
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^