0

I have a CentOS VM that shows the list of users like this:

drwx------. 2 504 504 4096 Dec 10 2000 username

So if I try to run the userdeel command I got a message saying that the user does not exist. How can I make sure this user does not exist and how can I remove the folder inside /home/

Thanks.

1 Answers1

0

It is because the user was probably deleted before, but the home directory was not.

You can simply delete the home directory of that user. Also, if you want to be sure there is no other trace (files/directories) created by that user you can search for them and delete them if you feel safe to do so.

The bellow command with find and delete every files and dir for userID 502 (remove the -exec rm -rf {} ;) if you only want to start with finding the ressources and not delete them right away.

find . -uid 502 -exec rm -rf {} ;

yield
  • 771
  • 1
  • 9
  • 24