Your logic is flawed: With the command you have right now, you find every non-
.svg or every non-
.jpg file. What you wrote reads as:
find (everything that's not an SVG or everything that's not a JPG)
So you'll get the JPG files, because
find already evaluated the first part and gave you everything that's not an SVG file. Because of the way the options are parsed, if the first part of an
or expression evaluates to true, the second part is not even looked at.
In essence, once
find returns you everything that's not an SVG, it doesn't care about what you want with the JPG files.
The correct way to phrase this would be with a logical
find . \( ! -iname '*.svg' -a ! -iname '*.jpg' \)
This reads as:
find (everything that's not an SVG and everything that's not a JPG)
Or, by negating the whole expression:
find . ! \(-iname '*.svg' -o -iname '*.jpg' \)
Which reads as:
find everything that's not (an SVG or a JPG)
Note that you can skip escaping the
* if you simply put it in single or double quotes, e.g.
-iname '*.jpg'. This is much easier to read.