userdel
The command that removes a user account, and with -r its home directory too.
In more detail
userdel removes the account from the password, shadow and group files. Without -r the home directory stays behind, owned by a number that no longer has a name, which a later account with the same number would inherit.
Example
userdel -r tmpuser removes the account and its home.Related terms
- useradd — The command that creates a user account.
- usermod — The command that changes an existing user account.
Taught in
- Starters, Leavers And A Service Account: Accounts On Two Families — CompTIA Linux+ (XK0-006) Exam Prep