DEV Community

Cover image for How to delete a user in Linux?
MELVIN GEORGE
MELVIN GEORGE

Posted on • Originally published at melvingeorge.me

How to delete a user in Linux?

Originally posted here!

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
Enter fullscreen mode Exit fullscreen mode
  • 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 😃.


Discussion (0)