Quantcast
Channel: How do I deduplicate -exec expressions in a find command? - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

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

$
0
0

-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 all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>