Quantcast
Viewing latest article 1
Browse Latest Browse All 2

Answer by Stephen Kitt for How do I deduplicate -exec expressions in a find command?

-or has lower precedence than -and (which is the default connector), so you need to explicitly increase your disjunction’s “priority”:

find . -path "./dist" -prune -or \( -iname "*.js" -or -iname "*.jsx" \) -exec grep "foo" {} +

Viewing latest article 1
Browse Latest Browse All 2

Trending Articles