# Zsh: glob case-insensitively with the (#i) glob flag and the no\_case\_glob option

DevFeed: [Zsh: glob case-insensitively with the (#i) glob flag and the no\_case\_glob option](<https://devfeed.tech/articles/zsh-glob-case-insensitively-with-the-i-glob-flag-and-the-no-case-glob-option-110591.md>)

Original publisher: [Read original article](<https://adamj.eu/tech/2026/10/30/zsh-case-insensitive-globbing/>)

Author: Adam Johnson

Published: 2026-10-30T00:00:00Z

Content type: article

Language: en

Sources: [Adam Johnson](<https://devfeed.tech/sources/adam-johnson.md>)

Topics: [Zsh](<https://devfeed.tech/topics/zsh.md>)

Tags: [zsh](<https://devfeed.tech/tags/zsh.md>)

## AI overview

Zsh globs are case-sensitive by default, regardless of whether the filesystem is case-insensitive. For a single pattern, add `(#i)` where case-insensitive matching should begin; it applies through the rest of the pattern, including directory names. This glob flag requires `extended_glob`, which can be enabled in `~/.zshrc`. To make all globs case-insensitive, enable `no_case_glob`; this also matches directory names such as `Photos/` in `photos/*.jpg`. Enable `case_paths` as well if literal directory names should remain case-sensitive. The article notes that `set -o` reports options in their "no" form by default, so `nocaseglob off` indicates case-sensitive globbing.

## Source excerpt

By default, Zsh globs are case-sensitive, so *.jpg matches beach.jpg but not CAT.JPG or dog.Jpg: $ ls photos/*.jpg photos/beach.jpg This is true even on macOS, where the filesystem is case-insensitive by default. Zsh shares this behaviour with Bash, but provides per-glob and global controls to ...