2

From the find manpage:

Please note that -a when specified implicitly (for example by two tests appearing without an explicit operator between them) or explicitly has higher precedence than -o. This means that find . -name afile -o -name bfile -print will never print afile.

Where is the implicit -a in the example?

oguz ismail
  • 1
  • 16
  • 47
  • 69
Malory
  • 21
  • 1
  • From the manpage: **The -print action is performed on all files for which the whole expression is true, unless it contains an action other than -prune or -quit.** – Malory Aug 24 '20 at 10:20
  • Your answer means, that the -print action is part of it's evaluation – very strange behaviour. – Malory Aug 24 '20 at 10:23
  • It's consistent behavior and not strange if you think about it. All of the options, including actions, are part of the find expression, so they need to have a "value" for the expression to make sense. `-print` is always true. – lurker Aug 24 '20 at 11:02

0 Answers0