-p, --parents remove DIRECTORY and its ancestors; e.g.,
rmdir -p a/b/c' is similar to
rmdir a/b/c a/b a'
Yeah - I'm definitely not going to risk testing that out myself. ;)
-p, --parents remove DIRECTORY and its ancestors; e.g.,
rmdir -p a/b/c' is similar to
rmdir a/b/c a/b a'
Yeah - I'm definitely not going to risk testing that out myself. ;)
It does precicely what it says: it attempts to remove all the directories in the path that you give to it.
If you give it an absolute path, it will attempt to remove all the way back to root, so make sure you give it a relative path.
If it removes absolute paths, then will it also remove all of the descendants of each of its ancestors too? So if I gave it an absolute path, would it also remove /bin, /usr, /var, and /etc?
– InquilineKea Oct 05 '11 at 20:01rmdir
will only remove empty directories. – James Sneeringer Oct 05 '11 at 20:18rmdir /a/b/c /a/b /a /
. So even if/a/b/c
actually existed, it would fail when it got to removing/
, since other directories still exist (you'd get "Directory not empty") – Michael Mrozek Oct 05 '11 at 20:19