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

From: Pádraig Brady <[email-masked]>
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