joyjoy,

If you have a very large directory, find will check each individual file, even when -path doesn’t match, which makes it take longer to complete. Combine -o and -prune to omit them entirely.


<span style="color:#323232;">find . -path '**/node_modules/**' -prune -o -type f -name '*.js' -exec grep 'import' {} +
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • fightinggames
  • All magazines