- **Epistemic status:** #seedlings
To delete a user in [[Linux]] you will need to log into the system as a **root** user or an account with **sudo** privileges. After that, enter the following command, replacing `<username>` with the username you want to delete:
```bash
sudo userdel <username>
```
This command will leave the files, mail spool, and SELinux users that the user has created. You can add the following options to remove these if needed:
- `-r` - Deletes the user home directory and mail spool.
- `-f` - Deletes any other files created by the user in other locations.
- `-z` - Deletes any SELinux users mapped to the user marked for deletion.
---
## References
- EDUCBA. “Linux Delete User | How to Delete a User from Linux Server,” February 2, 2021. <https://www.educba.com/linux-delete-user/>.