TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Setting to ignore /node_modules with find and grep

2 pointsby ereckersabout 9 years ago
Searching files in terminal and node_modules is making my life extremely uncomfortable.<p>Project directory looks like so:<p><pre><code> project&#x2F; ├── index.html ├── node_modules ├── js&#x2F; │ └── scripts.js └── style.css </code></pre> I find myself using `find . | xargs grep &quot;text string&quot;` to search the project directory.<p>I want to ignore everything in node_modules all of the time.<p>I&#x27;m familiar with --prune and ignoring, etc.. but I want something like an alias in my .profile that ALWAYS ignores the contents of node_modules.<p>I&#x27;ve looked around, but I just don&#x27;t know if I&#x27;m asking the question correctly.<p>Anyone have any solutions?

1 comment

kspaansabout 9 years ago
Tried `git grep`? It&#x27;s a nearly full grep, and will ignore things that aren&#x27;t tracked in the repo.