The userdel command does not remove home directories by default. It only removes the user account. If you want to remove the user account along with their home directory, you need to use the -r option with the userdel command.
Here’s the command to do that:
sudo userdel -r username
This will remove the user account and also delete their home directory and mail spool.
