how to remove user in linux using userdel command | Pro Tech guides

how to remove user in linux using userdel command

userdel command in linux allows you to remove a user in linux. using -r flag with this userdel command to delete the user from the home directory.

userdel command | remove user in linux | flags | Examples

remove user from linux using userdel command
Remove user from linux

Hello, guys welcome to the next session on Linux command line tutorial.

In the last session, I show you how to create users in Linux using the "useradd" command.

Today I'm going to show you how you can remove users using "userdel" command.

Remove a user

delete user in linux using userdel
userdel command

$sudo userdel userName
So in order to remove a user, we use a command called "userdel".

You need to give root permission before remove "users". So you must use "sudo" before this command.

So just write "sudo userdel userName" and press ENTER. It asks the root user's password. Enter the password and press ENTER KEY

 
Now you will observe even if you delete the user the "home directory" for this user is not deleted.

This command going to delete the username, password and other data for the user.

But it's not going to delete the home directory for the user.

use [-r] flag to remove a user from the home directory

delete user in linux using flags
delete user from home directory

You just need to use "sudo userdel -r userName".

  • "-r" flag in order to remove the home directory.

So if you want to delete the "user" and also the "home directory" of the user. Then use "-r" flag with "userdel" command.

Otherwise use "userdel" with the "userName".

Conclusion

So in this way you can "remove user" using Linux command. I hope you've enjoyed this tutorial please rate comment and bye.

HAVE A NICE DAY💖

Related,

Name

Apps,3,Games,1,Linux,38,Linux Commands,37,Network-Devices,1,Networking,1,Terminal Apps,2,Termux,17,Userland,3,Windows,1,
ltr
item
Pro Tech guides: how to remove user in linux using userdel command
how to remove user in linux using userdel command
userdel command in linux allows you to remove a user in linux. using -r flag with this userdel command to delete the user from the home directory.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinzGnJEtUHCt_woU97U4jaesW2E7F0f26gAO9VH-BbmfP24gN1qCIgNukRc6iIa__zM7oeQTHXnB2cWmdM5gR3R4xevcBpqSUaM5uyN9IFhP9fnJahwOVgeCTuxNNoq60tIMW_jPvhYrc/s16000/remove-user-in-linux.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinzGnJEtUHCt_woU97U4jaesW2E7F0f26gAO9VH-BbmfP24gN1qCIgNukRc6iIa__zM7oeQTHXnB2cWmdM5gR3R4xevcBpqSUaM5uyN9IFhP9fnJahwOVgeCTuxNNoq60tIMW_jPvhYrc/s72-c/remove-user-in-linux.png
Pro Tech guides
https://devops-digest.blogspot.com/2021/01/how-to-remove-user-in-linux-using-userdel-command.html
https://devops-digest.blogspot.com/
https://devops-digest.blogspot.com/
https://devops-digest.blogspot.com/2021/01/how-to-remove-user-in-linux-using-userdel-command.html
true
7053638852026728047
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content