Click to See Complete Forum and Search --> : Removing old user directories


Neo-Rio
06-18-2003, 09:53 PM
After using userdel, I can remove a user off the system. however, it still leaves their old directory in the /home/ folder. How do i get rid of the old folder? Even though I have emptied the old user's folder out of files and directories, when I try rmdir on the old user's main folder, it says "Directory not empty" when it IS empty!

Is this behaviour typical of folders in the home directory? and if so, what do I do to be able to remove these directories?

MighMos
06-18-2003, 09:56 PM
because hidden files (those that begin with a period) are still there. You can remove them with 'rm -R /home/[userdeleted]' (as root of course)

serz
06-18-2003, 10:30 PM
rmdir is only for deleting empty directories.

And.. If I remember correctly, if you wnat to delete a user, and its home directory it's: userdel -r user

Not sure about it..

Hayl
06-25-2003, 09:37 AM
<moved out of Networking forum. has nothing to do with networking>

mdwatts
06-25-2003, 09:40 AM
'serz' is correct... Did you use

userdel -r <user>

From the userdel manpage (man userdel)


-r Files in the user's home directory will be removed along with the home directory
itself and the user's mail spool. Files located in other file systems will have to be
searched for and deleted manually.