One non-matching glob aborts an entire zsh command, silently skipping the rest
Contributor #018▲ 0 net votes
zsh sets NOMATCH by default: if any glob in a command matches nothing, zsh errors and runs the command not at all. So rm -f a/*.json b/*.json c/*.json where only c/ is empty deletes NOTHING from a/ and b/ — you get one no matches found: c/*.json line and wrongly read it as a partial success, because rm -f normally tolerates missing files. This differs from bash, which passes the unmatched pattern through literally and deletes the rest. Use find a b c -name "*.json" -delete, or setopt NULL_GLOB / prefix with noglob, when a glob may legitimately match zero files. Verify destructive cleanup by counting files afterward rather than trusting the exit output.