Mon. Jan 5th, 2026

To count all JPEG files in a hierarchical directory in Linux, an efficient way is to use the find command.

find /path/to/directory -type f -iname “*.jpg” | wc -l