Double rm verification in zsh

The message “zsh: sure you want to delete all the files” is a zsh feature, specifically triggered by invoking a command called rm with an argument that is * or something/* before glob expansion. You can turn this off with setopt rm_star_silent.

The message “rm: remove regular file” comes from the rm command itself. It will not show up by default, it only appears when rm is invoked with the option -i. If you don't want this message, don't pass that option. Even without -i, rm prompts for confirmation (with a different message) if you try to delete a read-only file; you can remove this confirmation by passing the option -f.

Since you didn't pass -i on the command line, rm is presumably an alias for rm -i (it could also be a function, a non-standard wrapper command, or a different alias, but the alias rm -i is by far the most plausible). Some default configurations include alias rm='rm -i' in their shell initialization files; this could be something that your distribution or your system administrator set up, or something that you picked up from somewhere and added to your configuration file then forgot. Check your ~/.zshrc for an alias definition for rm. If you find one, remove it. If you don't find one, add a command to remove the alias:

unalias rm

The correct command to disable the double verification seems to be setopt rm_star_silent. To enable the double verification do setopt no_rm_star_silent.

For more detailed information look at the man page for zshoptions man zshoptionsor http://linux.die.net/man/1/zshoptions


I don't know why but the following works for me - no questions asked

rm -f **

Or, if directories are involved:

rm -rf **

Tags:

Zsh

Rm