Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 7 down vote accepted

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).

share|improve this answer
    
what about sudo rm -rf ...? –  MiJyn Nov 28 '12 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 '12 at 18:59
    
@MiJyn the f is only to not ask for confirmation ;) –  Rinzwind Nov 28 '12 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 '12 at 19:37
1  
me too @MiJyn but on AU I always choose the safer option ;) –  Rinzwind Nov 28 '12 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.

share|improve this answer
    
Thank you Victor, great alternative! Appreciate –  DextrousDave Nov 29 '12 at 7:53
1  
Also correct. Just do not use it for anything else... bad things can happen if you do :) –  Rinzwind Nov 29 '12 at 8:30
    
@Rinzwind: good advice :) –  Yamaneko Nov 29 '12 at 13:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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