Forrest logo
back to the userdel tool

userdel:tldr:3ee86

userdel: Remove a user along with the home directory and mail spool.
$ sudo userdel --remove ${username}
try on your machine

The command sudo userdel --remove ${username} is used to delete a user account from a system with administrative privileges. Let's break down the command:

  • sudo: It is used to execute the command with root or superuser privileges. It requests the user to input their password before giving them the necessary permissions to perform the command.
  • userdel: It is the command used to delete a user account.
  • --remove: It is an option used with userdel to remove the user's home directory and mail spool along with their account.
  • ${username}: It is a placeholder for the actual username. You need to replace ${username} with the specific username of the account you want to delete.

When executed, the command will delete the specified user account, including their home directory and mail spool, if the --remove option is used. This action is generally irreversible, so caution should be exercised when using this command.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the userdel tool