Deleting a Linux user closes a local login that should no longer be available, but it can also remove the account's home directory and mail spool. A safe deletion starts by confirming the exact account, checking for active work, and deciding what user-owned data must stay before the account record is removed.
Most Linux systems provide userdel from the shadow account-management tools. The --remove option deletes the account and removes its home directory plus local mail spool when they exist, while files owned by the account outside that home directory can remain on disk under the old numeric UID.
A regular local account is the right target here; service accounts and the account currently being used for administration need separate change planning. If access should only be suspended, lock or expire the account instead of deleting it.
Related: How to create a user in Linux
Related: How to lock a user account in Linux
$ getent passwd audituser audituser:x:1001:1001:Audit User:/home/audituser:/bin/bash
Replace audituser with the target login. A normal login usually has a home path under /home and a UID in the regular-user range for the distribution.
$ ps -u audituser -o pid,tty,stat,cmd
PID TT STAT CMD
No rows below the header means the account has no current processes in this check. Sign out or stop active work before deleting the account.
Related: How to show logged-in users in Linux
Related: How to force a user to log out in Linux
Deleting with --remove removes /home/audituser and the mail spool when they exist. Files owned by the user outside the home directory can remain on disk under the old numeric UID.
$ sudo userdel --remove audituser userdel: audituser mail spool (/var/mail/audituser) not found
The mail spool message is expected when the account has no local mail spool. On Debian or Ubuntu, sudo deluser --remove-home audituser is another supported account-removal command.
$ id audituser id: 'audituser': no such user
$ ls -ld /home/audituser ls: cannot access '/home/audituser': No such file or directory
If the command shows a remaining directory, review its contents before deleting or reassigning ownership.