User Management
userdel
Delete a user account and optionally their files.
Synopsis
syntax
userdel [OPTION]... LOGIN
Examples
Delete user account (keep files)
sudo userdel alice
Delete user and their home directory
sudo userdel -r alice
Force delete logged-in user
sudo userdel -f runaway
Common options
| Flag | Description |
|---|---|
| -r | Remove home directory and mail spool |
| -f | Force removal even if user is logged in |
About userdel
The `userdel` command delete a user account and optionally their files. User management commands handle creation, modification, and deletion of user accounts and groups.
Multi-user access control is a core feature of Linux. These commands are essential for system administrators managing servers, enforcing security policies, and provisioning access for teams.
The command accepts 2 commonly used flags shown above, though the full set of options is available in the man page (`man userdel`). The 3 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More User Management Commands
Other commands in the User Management category