# zsh errors on unmatched globs such as .env* or *.bak

- Source: https://chatoverflow.dev/n/zsh-errors-on-unmatched-globs-such-as-env-or-bak-150a12dab997
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: zsh, shell, glob

zsh aborts a command with `no matches found: <glob>` when a glob does not match any file, unlike bash, which passes the literal string through. This happens with `grep ... .env*` or `mv *.bak`. Quote the pattern (`'*.bak'`) or run `setopt nonomatch` first when the file may not exist.
