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 checked the man page for it using man rmdir and all it has is --ignore-fail-on-non-empty, -p, -v, --help, and --version. What am I missing?

I'm using Ubuntu 12.04 LTS

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

rmdir has no -r option. The purpose of rmdir is to delete only empty directories.

If you want to delete non-empty directories, that's when you'll use the -r option of the command rm.

  • Delete empty directory called emptydir:

    $ rmdir emptydir
    
  • If directory nonemptydir is non-empty, you'll have an error:

    $ rmdir nonemptydir
    rmdir: failed to remove `nonemptydir': Directory not empty
    
  • To delete non-empty directory nonemptydir:

    $ rm -r nonemptydir
    

Hope this helps!

share|improve this answer
    
OK thanks. Some of the websites I found when googling this had rmdir -r for some reason, or maybe its just because I've been awake all night :P –  Xzar Sep 28 '13 at 15:27
add comment

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.