On Tue, 23 Oct 2012 11:20:41 -0700, Tim Bird wrote:
> On 10/23/2012 11:04 AM, Todd Fischer wrote:
> > I use a tool, finds, I got from someone about 15 years ago.  It
> > simply does a recursive look for a string in all files of interest
> > in a directory tree.  When I get a big tarball of code that I don't
> > intend to build, but want to grab some logic, I use finds.  I have
> > created a variety of variations of finds (which I usually later
> > throw away) as my search needs change.  Essentially finds is
> > 
> > find . -exec fgrep -H "$1" {} \;
> > 
> > but with lots and lots of other qualifiers.  You can see a usable
> > version at
> > 
> > https://www.ridgerun.com/developer/wiki/index.php/Tip_of_the_day#finds_-_find_a_string_in_common_text_files
> 
> This looks useful.
> 
> I do something similar with the kernel.  I have
> a small one-line wrapper called armcgrep, which greps only the files
> in the arch/arm section of the kernel source tree, and only those
> with filenames matching the pattern "*.[chS]".  Once things
> are in the page cache, it works pretty fast.
> 
> 'finds' looks similar, but it also omits some areas, and includes
> things like Kconfig and others.  I need to mentally digest all
> the 'find' magic in it...

Note also that you can use 'git grep', that will only grep the source
files that are under version control, skipping all object files and
other generated files you may have in your tree, if you're not doing
out of tree builds. I use 'git grep' routinely.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
Celinux-dev mailing list
Celinux-dev@lists.celinuxforum.org
https://lists.celinuxforum.org/mailman/listinfo/celinux-dev

Reply via email to