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

后端 未结 9 1447
旧时难觅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:36
    find /path -type f \( -iname "*.jpg" -o -name "*.jpeg" -o -iname "*gif" \)
    
    0 讨论(0)
  • 2020-12-04 06:37
    find /path/to -regex ".*\.\(jpg\|gif\|png\|jpeg\)" > log
    
    0 讨论(0)
  • 2020-12-04 06:37
    find -regex ".*\.\(jpg\|gif\|png\|jpeg\)"
    
    0 讨论(0)
提交回复
热议问题