Subject: bug#21084: rm appears to no longer be POSIX compliant (as of 2013 edition) re: deleting empty dirs and files under <path>/.

From: Bernhard Voelker <[email-masked]>
Date: Sun, 2 Aug 2015 22:31:16 +0200

On 08/02/2015 10:15 AM, Paul Eggert wrote:
> Linda Walsh wrote:
>> find, by itself, has no way to remove all of the items under a
>> tree even if you own them all.
> 
> That's not a problem.  Have 'find' call 'rm'.  Something like this, say:
> 
> find . ! -name . -prune -exec rm -fr {} +
> 
> So there's no need to change 'rm'.

+1

Adding additional code to find out if the file to remove is still on the
same file system would add bloat, and would open another can of worms:
corner cases, races and a big performance penalty.  E.g. one might blindly
assume that only directories are mount points, but in reality also a
regular file can be 'over-mounted'.

Have a nice day,
Berny