Skip to content
Latchkey

find -iname: Case-Insensitive Name Match

find -iname is the case-insensitive version of -name.

Useful when artifact names vary in case across tools or platforms, for example README vs readme or .JPG vs .jpg.

What it does

find -iname PATTERN matches the base name against the glob without regard to letter case, so -iname *.JPG matches file.jpg, file.JPG, and file.Jpg alike.

Common usage

Terminal
find . -iname '*.md'
find . -iname 'readme*'
find assets -iname '*.png'

Options

PredicateWhat it does
-iname PATTERNCase-insensitive base-name glob match
-name PATTERNCase-sensitive base-name match
-ipath PATTERNCase-insensitive match against the whole path

In CI

Linux file systems are case sensitive while macOS runners are usually case insensitive by default. A build that works on a Mac runner because the file system folds case can fail on Linux; -iname makes the intent explicit and portable.

Common errors in CI

-iname is supported on both GNU find and BSD/macOS find, so it is portable. If a pattern still misses files, it is usually an unquoted glob expanded by the shell, the same "paths must precede expression" failure as with -name. Quote the pattern.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →