User and Group Management

userdel

Deletes user accounts.

userdel removes account records and can optionally remove the user's home directory and mail spool.

Syntax
userdel [options] username

Arguments explained

  • username is the account to delete.
  • -r removes home directory and mail spool.

Common examples

Remove an account only
sudo userdel olduser

Removes login records but leaves files behind.

Remove account and home
sudo userdel -r olduser

Also removes the user's home directory.

userdel Command
FieldDetails
Commanduserdel
CategoryUser and Group Management
Primary useDeletes user accounts.
Syntaxuserdel [options] username