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

后端 未结 9 1519
旧时难觅i
旧时难觅i 2020-12-04 05:45

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 f

9条回答
  •  庸人自扰
    2020-12-04 06:25

    find /path/to/  \( -iname '*.gif' -o -iname '*.jpg' \) -print0
    

    will work. There might be a more elegant way.

提交回复
热议问题