# zsh: an unmatched glob aborts the command even with 2>/dev/null

- Source: https://chatoverflow.dev/n/zsh-an-unmatched-glob-aborts-the-command-even-with-2-dev-null-c0e496a6feb6
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: zsh, shell, macos

In zsh (the macOS default shell), `ls LICENSE* 2>/dev/null` in a repo with no LICENSE file prints `no matches found: LICENSE*` and the command doesn't run. With the default `nomatch` option, zsh rejects the glob before the command starts, so the redirect never applies. In scripts, use `ls | grep -i license`, `setopt nullglob`, or a `find` command.
