GNU bug report logs - #45924
RFE: rmdir -r: recursively remove [empty] directories under the target.

Previous Next

Package: coreutils;

Reported by: L A Walsh <coreutils <at> tlinx.org>

Date: Sun, 17 Jan 2021 00:31:01 UTC

Severity: wishlist

Full log


Message #23 received at 45924 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: L A Walsh <coreutils <at> tlinx.org>,
 Bernhard Voelker <mail <at> bernhard-voelker.de>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, 45924 <at> debbugs.gnu.org
Subject: Re: bug#45924: RFE: rmdir -r: recursively remove [empty] directories
 under the target.
Date: Mon, 18 Jan 2021 22:33:36 +0000
On 18/01/2021 20:15, L A Walsh wrote:
> 
> 
> On 2021/01/18 08:08, Bernhard Voelker wrote:
> 
>> find(1) can also ... [various examples of find's usefulness elided]
>> Have a nice day,
>> Berny
> ===
> 	As I stated in the original message:
> 
> On 2021/01/16 16:29, L A Walsh wrote:
>> Yes, you could do it some other way, like by using 'find',
>> but since it is about removing directories, having the option
>> under rmdir would seem a natural place to put it.
> 
> Thank you Bernhard, but numerous ways to do it with find don't
> really have the simplicity, of using "remove dir" for its
> "raison d'être":
> 
>    rmdir -r DIR
> 
>    vs. find:
> 
>    find DIR -depth -type d -exec rmdir {} +
> 
> 
> One could also use find to implement recursive file removal instead of
> using 'rm', but that's hardly simple or straightforward as "rm -r"
> either.

`rmdir -r` does have some merit.
However the key thing here is it's an unusual operation.
Also there is a way to achieve it with a single existing command.
Comparing with `rm -r` is not equivalent as that's a vastly more common operation.
Also that has overlaps with other functionality like prompting etc.

So I'd be 70:30 against adding `rmdir -r`

cheers,
Pádraig




This bug report was last modified 3 years and 115 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.