I'm using Ubuntu 12.10

I have a folder inside /var/www/wordpress/wp-content/themes/myFolder called myFolder. Inside myFolder there are subfolders. Now I cannot remove it via the GUI, and when using terminal it also does not work, perhaps because I'm doing it wrong. I said:

sudo rmdir /var/www/wordpress/wp-content/themes/myFolder/* 

and I also tried just rm, but it keeps telling me "directory not empty" and some other errors as well. How do I delete it then that folder with all its contents?

Thank you

2 Answers 2


sudo rm -R /var/www/wordpress/wp-content/themes/myFolder/*

-R to recursively remove anything inside it (and deeper).

This also removes files (not just directories).

  • what about sudo rm -rf ...?
    – MiJyn
    Nov 28, 2012 at 18:31
  • It is the same. The only difference is that -f flag means --force ignore nonexistent files, never prompt. No message will appear telling you that you are going to delete something.
    – Diego
    Nov 28, 2012 at 18:59
  • @MiJyn the f is only to not ask for confirmation ;)
    – Rinzwind
    Nov 28, 2012 at 19:34
  • yeah, of course, but I don't like being at my terminal always asked for confirmation of file deletion (especially if there are many)
    – MiJyn
    Nov 28, 2012 at 19:37
  • 1
    me too @MiJyn but on AU I always choose the safer option ;)
    – Rinzwind
    Nov 28, 2012 at 19:39

Complementing the answer of Rinzwind, you can also do it through GUI. You probably didn't have permissions to remove it as a normal user. Then, you need to launch file explorer as root. You can launch GUI as root by two different ways:

  • Alt+F2 gksu nautilus
  • Or, in a terminal, type sudo nautilus

In both ways, you can navigate to myFolder and delete it.

  • 1
    Also correct. Just do not use it for anything else... bad things can happen if you do :)
    – Rinzwind
    Nov 29, 2012 at 8:30
  • @Rinzwind: good advice :)
    – Yamaneko
    Nov 29, 2012 at 13:32

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.