How to delete a user in Linux?

July 29, 2021 - 1 min read

To delete a user in Linux, you can use the userdel command followed by a space and the name for the user to delete in Linux.

For example, let's say you want to delete a user called john, you can use the userdel command like this,

# Delete a user in Linux
sudo userdel john
  • Sometimes you may need to use the sudo command before the userdel command to obtain the correct privileges to execute the command.

Try executing the above command in this online terminal to see the result.

Feel free to share if you found this useful 😃.