Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Super newbie here, I am trying to delete this user from my system. But instead of using 'userdel -r user1' i forgot to add the '-r' and just keyed in 'userdel user1'. Then I noticed in the home directory that the user is still there, but is removed from the /etc/passwd directory. I tried using 'userdel -r user1' again, but system responds as 'user is deleted'. How to respond to this? as I want to delete that user?
And additionally, from the home directory. A colleague of mine, instead of creating a user using the 'useradd' command, he decided to just use 'mkdir user' at the home directory. Is it ok to use 'rmdir user' at the home directory? without causing any troubles to the system? I need advise, thank you so much..
I can see that you are putting a lot of time and effort into your blog and detailed articles! I am deeply in love with every single piece of information you post here
You seem to be confused about the difference between a user (actually a user account) as defined in /etc/password and files and directories.
You have already deleted the user, want you are trying to do is delete files that were owned by the user (in this case the users home directory and contents).
You can remove the users old home and files in it using the rm command.
Code:
rm -r /home/user1
However, you should probably also use the "-f" option otherwise you will have to confirm before rm goes into each subdir. Be warned that this will permanently remove these files, so be careful (I have even avoided typing it explicitly).
If you suspect that the user also has files elsewhere on the system you can search for them with the "find" command (you should know the users numeric id). Let us know if you want pointers on using find.
I can see that you are putting a lot of time and effort into your blog and detailed articles! I am deeply in love with every single piece of information you post here
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.