Delete User

Much like your user account for macOS or Windows, Linux creates a folder for each user. This folder usually has filepath that looks something like "/[username]" (e.g. "/root").

And just like macOS and Windows, when deleting a user account, you can decide if you want to keep or delete the user folder.

Delete User (without deleting user folder/account files)

Syntax

userdel [username]
  • [username] -- The username of the Linux account you wish to delete.

Example

userdel david

Delete User (and folder/account files)

Syntax

userdel -r [username]
  • -r -- Flags the user account folder for deletion.
  • [username] -- The username of the Linux account you wish to delete.

Example

userdel -r david