Is there any resultant difference on disk between using rm or rmdir to remove a directory?
Or is it only different by usage preference, By example, given
$ mkdir a $ mkdir a/b $ mkdir a/b/c
$ rmdir -p a/b/c
have the same effect as
$ rm -r a
just looking at it from a different end?
rmdiris a little safer, sometimes. If you issue
mkdir testand then
touch test\aand then
rmdir test, you will get an error that the directory is not empty. If you issue
rm -r test.....
rmdirremoves only empty directories , while
rm -rwill remove even non-empty directories