-i, -I, --interactive, --prompt-each, --prompt-once
Prompt before removals: -i (every file), -I (once), --interactive[=WHEN].
An option of rmx.
Usage
rmx --interactive[=string] [FILE]...
rmx -i [FILE]...
rmx --prompt-each [FILE]...
rmx -I [FILE]...
rmx --prompt-once [FILE]...Description
rmx offers three levels of confirmation. -i prompts before every single removal. -I prompts just once before removing more than three files or before any recursive removal - less intrusive than -i while still guarding against the worst mistakes. --interactive[=WHEN] selects the level explicitly, where WHEN is never, once, or always (bare --interactive means always). When several are combined, rmx picks the most cautious: -i > --interactive=WHEN > -I > -f.
Permissions
On a terminal, a write-protected file normally prompts 'remove write-protected ...?'. -i replaces that with an ordinary prompt for every file regardless of mode, while --interactive=never (like -f) suppresses the write-protected prompt entirely. The prompts never change what you are permitted to delete - only whether you are asked.
Use cases
- Reviewing each deletion when clearing a directory of mixed important and junk files (
-i). - A single safety confirmation before a large or recursive delete (
-I). - Scripting a specific prompt policy independent of
-f(--interactive=WHEN). - Overriding a
-fbaked into an alias, since-iis more cautious and wins. - Feeding prepared answers from a pipeline (
yesx) in tests.
Details
| Short | Long | Value | Default | Meaning |
|---|---|---|---|---|
--interactive | string (optional) | prompt according to WHEN: never, once, or always | ||
-i | --prompt-each | none | prompt before every removal | |
-I | --prompt-once | none | prompt once before removing more than three files, or when removing recursively |
Examples
Ask before removing a single file
rmx -i notes.txtAsk once, then recursively remove a project directory
rmx -I -r project/Delete without any prompt, equivalent to -f for prompting
rmx --interactive=never old.tmpAsk once before removing more than three files
rmx --interactive=once a.log b.log c.log d.log-i wins over -f, so every removal is still confirmed
rmx -fi draft.mdAnswer yes to every prompt from a pipeline
yesx | rmx -iv a.tmp b.tmpHelp in the terminal
gnux help rmx --interactive