1

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

0

1 Answer 1

4

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!

1
  • 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
    – Alex Mohr
    Sep 28, 2013 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .