Saying 'yes to all' using rm -i

Well, this doesn't really answer your question. But instead of using rm -i, consider aliasing rm to rm -I:

The man page states:

-I     prompt once before removing more than three files, or when removing 
       recursively. Less intrusive than -i, while still giving protection 
       against most mistakes

in your ~/.bashrc, put:

 alias rm='rm -I'

this is actually useful!


No.

(Unless you find a way to flip the 'interactive' bit with a debugger.)


Is there a way I can just say Yes to all?

The answer is yes, using this code:

$ yes "yes" | rm -vRI directory

  • v: show the list of files that have been removed
  • R: remove directories and their contents recursively
  • I: as per the recommendation above.

Tags:

Rm