LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Permission problems when removing user's home directory. (https://www.linuxquestions.org/questions/linux-software-2/permission-problems-when-removing-users-home-directory-345435/)

davethegenius 07-21-2005 12:51 PM

Permission problems when removing user's home directory.
 
Hello, I use Ubuntu Warty and cannot remove past user's home directories from the /home folder. I remove the user's account but their directory stays. I've been able to delete everything within the folders via chown
to my username (dave) but I'm unable to remove the main (now empty) home directories. Now the directory is clearly empty and root sees nothing in there but I get this error while in BASH. Here's my code:

root@ubuntu:/home # rmdir camp2005/
rmdir: `camp2005/': Directory not empty

Any help would be great. Thanks alot.

darkleaf 07-21-2005 01:16 PM

If you're completely sure it's empty (invisible config files, check "ls .*" or "ls -a") or don't want to keep anything:

"rm -rf camp2005/"

Be careful with it you want to make sure that you're really removing the intended folder as there's no way back ;)

perfect_circle 07-21-2005 01:16 PM

this folder is probably not empty.
There may be some hidden files (files starting with .) left there.
USE
Code:

ls -la /home/<username>
To find it out.
You may also use
Code:

rm -r <directory>
to remove a non empty directory and all its content
or
Code:

tm -fr <directory>
to force the removal without displaying any messages.
How did you remove the user?
If you used userdel the -r option would have removed the homedirectory of the user:
Quote:

NAME
userdel - Delete a user account and related files

SYNOPSIS
userdel [-r] login

DESCRIPTION
The userdel command modifies the system account files, deleting all
entries that refer to login. The named user must exist. The options
which apply to the userdel command are:

-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 manu-
ally.



tripwire45 08-11-2005 04:01 PM

I tried this out on my Debian box and discovered that I had to type "rm -R dirname" to remove a defunct user's home directory.


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