💾 Archived View for jb.smol.pub › macos-zsh-wildcards captured on 2024-05-10 at 10:42:35. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
As a long time "not zsh" user, I've recently been caught a few times by wildcards not working in ZSH.
Now ZSH has been the default shell in macOS for a while now but I've only recently started to switch, call me old fashioned.
The first time I ran into this was when I was trying to find a file I was sure existed, however the terminal gave me an error.
~ % find . -type f -name index* zsh: no matches found: index*
The way to make it work correctly is to put quotes around the term and wildcard.
~ % find . -type f -name "index*"
If you are interested, there is more reading at SuperUser with some good information on how it's related to the way that ZSH manages globbing characters to generate filenames.
I've also run into this issue using rsync and other MacOS/UNIX cli tools, so making a note in case it's helpful for others, or just for future self :-)
© JB