How to use find command to find all files with extensions from list?

Kirzilla picture Kirzilla · Apr 12, 2010 · Viewed 250.8k times · Source

I need to find all image files from directory (gif, png, jpg, jpeg).

find /path/to/ -name "*.jpg" > log

How to modify this string to find not only .jpg files?

Answer

find /path/to -regex ".*\.\(jpg\|gif\|png\|jpeg\)" > log