ack|grep|whatnot special ignore folders pattern node_modules/dir/node_modules
<p>I have recently discovered ack and <code>ack -ir --ignore-dir={node_modules,dist,.git} &lt;search-term&gt;</code> works great for most things but this </p>

<pre><code>---node_modules/
---------------project1/
-----------------------node_modules/
---------------project2/
-----------------------node_modules/
</code></pre>

<p>I would like to search all files under the "root" node_modules and excluding all internal ones. </p>

<p>Note: if I run <code>find . -type f | ack -v 'node_modules|.git|dist'</code> under the root node_modules folder, I get a proper file list. this happen because <code>find .</code> gives out relative paths. Any way to feed this list to ack ? </p>