I don’t think there’s any reason to use rmdir unless you write (Ba)sh scripts, and you want to make sure that the directory is indeed empty. Just use rm -r.
Also note that you can use rmdir -p this/is/some/path to remove all nested directories including the parent (this here). But this will only work if there’s exactly one directory per parent directory, and the last directory doesn’t have any files (including directories). This might be helpful for some scripts.
rmdir -r isn’t a thing, because that would invalidate the reason this command exists.
I don’t think there’s any reason to use
rmdir
unless you write (Ba)sh scripts, and you want to make sure that the directory is indeed empty. Just userm -r
.Also note that you can use
rmdir -p this/is/some/path
to remove all nested directories including the parent (this
here). But this will only work if there’s exactly one directory per parent directory, and the last directory doesn’t have any files (including directories). This might be helpful for some scripts.rmdir -r
isn’t a thing, because that would invalidate the reason this command exists.