Why does rm -f ask me for confirmation on zsh?

It seems that the RM_STAR_SILENT is NOT in effect.
You could do setopt rmstarsilent either in the command line or in ~/.zshrc to tell zsh to not confirm a rm *.

The shell option RM_STAR_SILENT is:

Do not query the user before executing rm * or rm path/*.

zshoptions(1): RM_STAR_SILENT


If you want to make the setopt effect temporally just in that shell function only, you could use it in conjunction with the localoptions like below:

my-test () {
  setopt localoptions rmstarsilent
  ...
}

Leave a Comment