I use BSD and Linux every day, I have never had a circumstance which I must use rmdir(1) rather than rm(1). What's the purpose of rmdir's existence?
Thank you!
|
|
The main reason is probably historical. Back in the old, old days, there were no (The 7th Edition UNIX manuals were available online until recently at http://cm.bell-labs.com/7thEdMan; they were not accessible there when I tried tonight, though. Google thinks they should be at http://plan9.bell-labs.com/7thEdMan; they are not accessible there, either, tonight. There does some to be at least one alternative source online still (http://wolfram.schneider.org/bsd/7thEdManVol2/) for the articles in Volume 2, but not for the commands and system calls in Volume 1.) The To use There's also a symmetry argument. You need a command |
|||||||||||||
|
|
"rm" does not work on directories. You have to either use rmdir or specify the -r switch for a recursive deletion. The reason is historical: |
|||||||||||
|
|
Also rmdir only removes empty directories. If you want to make sure you don't delete any additional files in a directory, |
|||
|
|