On Linux, rm can delete empty directories with -d too, not just with -r.
rmdir is the counterpart to mkdir, which creates empty directories, so of course it can only remove empty directories. After all mkdir can’t create full directories either. There however is rmdir -p as a counterpart to mkdir -p, so if there is something in the directory, you can use that, as long as the something is an empty directory.
I alias rm to rm -r for easy folder deleting
UGH that shit.
rm deletes a file. It can’t delete a directory, you have to use
rmdir to delete a directory…as long as there’s nothing in that directory. If there’s anything in the directory, you have to know to use
rm -r to delete a directory and its contents, and no
rmdir -r isn’t right somehow!
On Linux, rm can delete empty directories with -d too, not just with -r.
rmdir is the counterpart to mkdir, which creates empty directories, so of course it can only remove empty directories. After all mkdir can’t create full directories either. There however is rmdir -p as a counterpart to mkdir -p, so if there is something in the directory, you can use that, as long as the something is an empty directory.