Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


  Search this Thread
Old 07-06-2019, 07:58 AM   #1
LQ Newbie
Registered: Jul 2019
Location: Fl
Distribution: Centos, Ubuntu
Posts: 1

Rep: Reputation: Disabled
Question Delete user

Hi everyone, Iam using centos distro and Iam trying to delete a user using:
Sudo userdel or
Sudo deluser
But when I check using ls command I still see the user not sure why
Old 07-06-2019, 08:05 AM   #2
Senior Member
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,171
Blog Entries: 3

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
The one is for scripts and the other is for interactive use. So you probably ran deluser, which is more for scripts, and didn't add in the part about deleting the matching home directory. So the home directory got left behind. userdel is more for interactive use and will do a lot more by default.

You can remove the home directory separately, using rm if you are careful. You will need the -r and -f options while running it as root via sudo.

Last edited by Turbocapitalist; 07-06-2019 at 08:06 AM.
2 members found this post helpful.
Old 07-06-2019, 08:26 AM   #3
Senior Member
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora, Alpine, Cirros, OpenSuse/SLES
Posts: 3,464

Rep: Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913
For clarity: You probably removed the user from /etc/passwd and /etc/shadow, but the user’s home directory including all the user’s files is still there. This is so by design: User files may contain valuable data; one should not blindly delete them.
2 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
User Unable to delete files with ACL user:rwx on directory with sticky bit NightRook Linux - General 3 08-25-2015 09:06 AM
Delete a user from secondary user group. ankitky Ubuntu 2 08-13-2013 11:25 PM
How to edit PAM DB of VSFTPD (..add user, delete user, change user password ) jsaravana87 Linux - Server 1 10-02-2012 08:49 AM
[SOLVED] multiple user accounts with uid 0 . I want to delete all user names except "root" m00seman645 Linux - Newbie 2 10-21-2011 01:56 PM
How can I trace user's web surfing & delete large mail sent by the user by? mostafaashish Linux - Networking 4 08-07-2009 08:43 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration