Deleting a User
- Command:
userdel– Deletes a user account.
Options and Considerations
-
Without
-r: -
Deletes the user account only.
- Home directory and mail spool remain.
- Files in the home directory become orphaned (owned by UID/GID).
-
Example:
-
With
-r: -
Deletes the user account, home directory, and mail spool.
- Files outside the home directory remain as orphaned files.
-
Example:
-
Important:
-
Backup important files before deleting a user.
- Deletion is irreversible.