Try to do it
using grep :
grep -Hri function_name .
if you want only the path:
grep -ril function_name .
Explanation
- trailing
. indicates current directory -i : case insensitive-r : recursive-H : print file name for each match-l : suppresses normal output; instead, type the name of each input file from which output is usually printed.
See man grep
And last but not least
An interesting tool is ack , it will avoid searching in .svn , .cvs , .git dirs, etc. It is designed to search for code.
Example:
$ cd /usr/share/perl5 $ ack -r 'Larry\s+Wall' site_perl/Inline/C.pm 370:
or just the file path:
$ 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
No need to complete . using ack (compared to grep )
Gilles quenot
source share