Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>Try doing this</h2> <p>using <a href="/questions/tagged/grep" class="post-tag" title="show questions tagged 'grep'" rel="tag">grep</a> : </p> <pre><code>grep -Hri function_name . </code></pre> <p>if you want only the path :</p> <pre><code>grep -ril function_name . </code></pre> <h2>Explanations</h2> <ul> <li>the trailing <code>.</code> stands for <em>current directory</em></li> <li><code>-i</code> : <em>case-insensitive</em></li> <li><code>-r</code> : <em>recursive</em></li> <li><code>-H</code> : <em>Print the file name for each match</em></li> <li><code>-l</code> : <em>Suppress normal output; instead print the name of each input file from which output would normally have been printed.</em></li> </ul> <p>See <a href="http://betterthangrep.com/" rel="noreferrer"><code>man grep</code></a></p> <h2>Last but not least</h2> <p>An interesting tool is <a href="http://betterthangrep.com/" rel="noreferrer">ack</a>, it will avoid searching in <code>.svn</code>, <code>.cvs</code>, <code>.git</code> dirs and such... It is designed to search code.</p> <p>Example : </p> <pre><code>$ cd /usr/share/perl5 $ ack -r 'Larry\s+Wall' site_perl/Inline/C.pm 370:# bindings to. This code is mostly hacked out of Larry Wall's xsubpp program. core_perl/overload/numbers.pm 5:# Copyright (C) 2008 by Larry Wall and others core_perl/CPAN.pm 876:# From: Larry Wall &lt;larry@wall.org&gt; </code></pre> <p>or just file path :</p> <pre><code>$ ack -rl 'Larry\s+Wall' vendor_perl/LWP.pm site_perl/Inline/C.pm core_perl/overload/numbers.pm core_perl/CPAN.pm core_perl/SelfLoader.pm core_perl/AutoLoader.pm core_perl/AutoSplit.pm core_perl/Test/Harness.pm core_perl/XSLoader.pm core_perl/DB.pm </code></pre> <p>No need the ending <code>.</code> with <code>ack</code> (compared to <code>grep</code>)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload