> I'm not sure how to practically improve things.
> Perhaps we could have a --interactive=always-skippable
> where you could type 'a' to accept all future removals,
> though I'm not sure that helps much either TBH.

Yes! That would be great too.

My default `rm` aliases to `rm='rm -i '`, having this option would be extremely
useful to me.

https://github.com/JoaquimEsteves/dotfiles/blob/master/.bash_aliases#L10

This would allow a user to 'peek' into the files they are about to delete,
cancelling in case there's a mistake.

> Is this usefully giving more info though?
> ...
> The fact you're removing 22 files should be a huge warning.

This might be particular to my use-case, but I'm oftentimes deleting
directories like `node_modules/`, `.venv/` or a `.make_cache/` that feature
hundreds/thousands of files. I think that it's ok for an explicit `verbose`
mode to be, well, verbose.

If we wanted to get fancy, I could see some optional number being passed as the
maximum number of lines printed. Something like:

```
$ rm --interactive=once-verbose-3 .*
rm: Would remove 22 arguments
regular file '.foo'
regular file '.bar'
regular file '.bashrc'
... and 19 others
proceed?
```

Kind regards,
Joaquim Esteves


From: Pádraig Brady <[email protected]> on behalf of Pádraig Brady 
<[email protected]>
Date: Friday, 24 July 2026 at 17:34
To: Joaquim ESTEVES <[email protected]>; [email protected] 
<[email protected]>
Subject: Re: Feature Request: rm --interactive=once-verbose

[You don't often get email from [email protected]. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

On 24/07/2026 15:10, Joaquim ESTEVES via GNU coreutils General Discussion wrote:
> Hello,
>
> I'd like to request an extra option for the '--interactive' command for rm.
> Like many users I have an alias for 'rm' that adds the '-i' flag that should
> prohibit me from accidentally deleting important files. The issue is that that
> flag is too picky, while the '-I' flag is not informative enough.
>
> Recently I accidentally deleted a lot of files from my home-directory, and I
> believe that a more verbose interactive flag, something in between '-I' and
> '-I' would be helpful.
>
> Something like:
>
> ```
> $ rm --interactive=once-verbose .*
> rm: remove the following files?
> regular file 'foo'
> regular file 'bar'
> regular file '.bashrc'
> ...etc
> proceed?
> ```

Is this usefully giving more info though?
There is little point in presenting a huge list of files to users
as that is not practical to parse by someone.
Also if we presented a truncated list, then we might miss presenting
an important file.
>
> If we compare this to the existing '-I' flag, all I would have known about the
> files I'm about to delete are how many there are.
>
> ```
> $ rm --interactive=once .*
> rm: remove 22 arguments?
> $ # OOPS, deleted an important '.bashrc' file
> ```

The fact you're removing 22 files should be a huge warning.

I'm not sure how to practically improve things.
Perhaps we could have a --interactive=always-skippable
where you could type 'a' to accept all future removals,
though I'm not sure that helps much either TBH.

cheers,
Padraig

Reply via email to