Case-insensitive globbing

Setting the Bash shopt option to nocaseglob allows us to make globs match case-insensitively:

bash$ shopt -s nocaseglob
bash$ printf '%s\n' A*
april
august

In this example, the lowercase april and august were matched and returned, even though the glob started with an uppercase A.

Get Bash Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.