rename file with zmv

Do you only want to add a - to the filename? Try it like this:

zmv -n 'test(*).txt' 'test-${1}.txt'

The -n switch shows you what would happen without really performing any action.


This is an extra-ordinarily late reply since I also ran into this problem and was breaking my head over it. I finally figured out that the zsh customization layer I used (yadr) was aliasing zmv. alias zmv="noglob zmv -W". I believe even the popular oh-my-zsh layer does htis.

Check whether your zmv is aliased. If so unalias it using unalias zmv and that horrible number of wildcards must match error should disappear now