Home

userdel

Userdel is a command used on Unix-like operating systems to delete a user account from the local system. It removes the user’s entries from the system account databases (such as /etc/passwd and /etc/shadow) and from group structures (such as /etc/group) so the account can no longer be used to log in. By itself, userdel does not delete files owned by the user on the filesystem; those files usually remain unless explicitly removed.

Usage and options can vary by distribution, but common behavior is consistent across many Linux systems. The

Typical considerations:

- The user should not be logged in, and no processes should be running under that user, to

- After deletion, files owned by the user remain unless removed separately; use find or similar tools

- On some systems, auxiliary tools (such as deluser on Debian-based systems) offer similar functionality with different

See also: useradd, deluser/delgroup, passwd. The exact behavior and options can vary between Linux distributions and

basic
form
is:
userdel
[options]
username.
The
most
frequently
used
option
is
-r,
--remove-home,
which
requests
that
the
user’s
home
directory
and
mail
spool
be
deleted
as
part
of
the
removal
process.
Another
common
option
is
-f,
--force,
which
attempts
to
remove
the
user
even
if
the
account
is
currently
in
use
or
the
system
has
limitations
preventing
removal.
avoid
issues.
Administrators
may
terminate
related
processes
and
sessions
before
removal.
to
locate
and
address
them
if
needed.
syntax
or
additional
prompts.
other
Unix-like
systems.