Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently switched from bash, I noticed that zsh will try to expand every command or argument that looks like it has wildcards in it. So the following lines won't work any more:

git diff master{,^^}
zsh: no matches found: master^^

scp remote:~/*.txt .
zsh: no matches found: remote:~/*.txt

The only way to make the above commands work is to quote the arguments, which is quite annoying.

Q: How do I configure zsh to still try to expand wildcards, but if there are no matches, just pass on the argument as-is?

EDIT: Possibly related: scp with zsh : no matches found

share|improve this question
up vote 3 down vote accepted

It is an intended feature of zsh. when using any shell, it is considered best practice to quote any character that is considered a meta character to the shell. ^ is a pattern used to negate a string when the option extendedglob is set. * is a pattern used to match zero or more characters.

You can stop it by disabling the option nomatch. But by doing so, your unquoted patterns make your statements volatile, depending on what files may be present in the current working directory. You shouldn't do that.

share|improve this answer
Maybe I shouldn't, but it is quite tempting to do so. I used to think that I shouldn't have lots of aliases either. But in the end, all that matters is how long it takes for me to type in a command on my machine. – Attila O. Nov 5 '13 at 4:01

I am able to use wildcards without escaping the asterisk symbol in Z Shell. I am also using oh-my-zsh. Maybe that will help.

share|improve this answer
Now I use oh-my-zsh too. – Attila O. Nov 5 '13 at 4:24

For scp, see

For git, use ~ instead of ^.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .