Use parens
find Desktop/ \( -iname '*.JPG' -o -iname '*.jpeg' -o -iname '*.jf[il1]f' -o -iname '*.exif' -o -iname '*.tiff' -o -iname '*.gif' -o -iname '*.bmp' -o -iname '*.png' \) -exec cp -n {} test \;
Actually, -exec
is an action while -iname
is a predicate (a test in terms of man find
). They aren't interchangeable at all. Default action is -print
. So your expression means:
find Desktop -iname '*.JPG' -print \
-o -iname '*.jpeg' -print -o ... -o -iname -iname '*.png' -exec cp...
By using parens your group tests and the provide a single action for the entire group.