Sat. Dec 13th, 2025

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