In Debian, I want to remove a subdirectory of my home directory. When I try to remove it (with sudo), I get a message saying the directory is not empty, but I cannot see any file inside the directory with ls -l.

How do I remove this directory?

migrated from stackoverflow.com Nov 12 '09 at 10:09

This question came from our site for professional and enthusiast programmers.


rm -rf /home/user/directory

  • Thanks for this help. it worked. Thanks to all of you for your quick response. :-) – Reji S nair Nov 12 '09 at 9:52

try ls -a to see if there's any hidden file.

You can remove recursively using rm -r



ls -a -l

To show hidden files, then remove them.

Or, to force the directory and everything inside it to be deleted, try:

rm -r directory

Load up your terminal and type the following:

cd ~/

rm -rf ./my-directory

This should work assuming you have the correct permissions

  • I'm sorry, but there is a reason you are suggesting to connect via SSH? – mrucci Nov 12 '09 at 11:11
  • Sorry, I thought you were doing this on a remote machine. I've updated my answer accordingly. – KushalP Nov 30 '09 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy