I have just started using Zsh and I have noticed that the asterisk (*) wildcard operator does not seem to work in it. For example, running cd ~/Doc* does not change me into the ~/Documents directory when I run it as standard (non-superuser) user. What's Zsh's equivalent to Bash's * wildcard operator?
Asked
Active
Viewed 1,297 times
0
Josh Pinto
- 3,483
- 15
- 52
- 87
-
See also: [The result of ls \* , ls \*\* and ls \*\*\*](http://unix.stackexchange.com/q/62660) – Stéphane Chazelas Dec 24 '15 at 22:46
-
Nitpicking: a wildcard in globbing is actually one of `?`, `*`, or `[` - not just an asterisk. Of course with the shell it's not a regex but a glob but some might call that a thinner line (though there are important differences of course). – Pryftan Apr 27 '23 at 16:38
1 Answers
1
It is *.
% pwd
/homes/jdoe
% ls D*
zsh: no matches found: D*
% mkdir Documents
% cd Doc*
% pwd
/homes/jdoe/Documents
%
If the above Does Not Work(TM) for you, try it under zsh -f, which will disable any screwball code (e.g. oh-my-zsh) that might be throwing a monkey wrench into your shell configuration.
thrig
- 34,333
- 3
- 63
- 84