From mboxrd@z Thu Jan 1 00:00:00 1970 From: ralph@inputplus.co.uk (Ralph Corderoy) Date: Wed, 25 Apr 2018 23:09:16 +0100 Subject: [TUHS] rm command In-Reply-To: References: , Message-ID: <20180425220916.63C52206BE@orac.inputplus.co.uk> Hi Bill, > I think it’s a bit more interesting to uncover why rm does not remove > directories by default thereby obviating the need for rmdir Well, I'd guess it's: rm just does a single unlink to decrement an inode's reference count by one, actually increment it since they were negative, whereas rmdir on an empty directory needs to do two decrements, one for its directory entry in the parent, and one for `..'. (I think hard links could apply to directories in the early days, until it made things too awkward, e.g. du(1) and cycles.) -- Cheers, Ralph. https://plus.google.com/+RalphCorderoy