joyjoy, 1 month ago 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>
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.
-path
-o
-prune
<span style="color:#323232;">find . -path '**/node_modules/**' -prune -o -type f -name '*.js' -exec grep 'import' {} + </span>