I would like to find all png AND jpg files and used the following command and no results are returned however if I replace
-o it shows me the list of files. Why is that?
`find . -maxdepth 1 \( -iname \*\.png -a -iname \*\.jpg \)
A logic error. What you're telling
But, of course, there are no files that are both at the same time, which is why the
When constructing these queries just imagine
-a is a logical AND meaning that the file name must end in both .PNG and .JPG to be true.
-o is a logical inclusive OR meaning the file name must end in .PNG or .JPG (or both) to be true.