userdel

Delete a user account

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
passwd -l <user> && chage -E0 <user>Lock instead of delete
tar -czf <user>-home.tgz /home/<user>Back up before deleting
find / -user <user> -ls 2>/dev/nullFind files owned by the user
What it does

Deletes a user from /etc/passwd and /etc/shadow.

Common flags
FlagMeaning
-rRemove home directory and mail spool⚠ Permanently deletes the user’s files.
-fForce removal⚠ Even if the user is logged in.
Examples
userdel aliceRemove account, keep home · explain & risk-check →
userdel -r aliceRemove account and home · explain & risk-check →
Related
usermod useradd
Open the full explainer →More in Users, Permissions & Security

Reference text is hand-written and may be incomplete — check man userdel for your version. Test destructive commands on a non-production system first.