Discussion:
GREP and the KERNEL.
(too old to reply)
DigitalGod
2008-04-30 18:38:12 UTC
Permalink
Hello All,
I want to search for different things in the Linux Kernel Source tree.
I know I can use grep but HOW do I get grep to search through EVERY
Directory and FILE to find then text I am looking for INSIDE the
Source files? Exa... main();

I had grep finding every instance of main.c BUT it never looked INSIDE
the files.

Any help would be great. TIA...


http://www.n2dvm.com
Lew Pitcher
2008-04-30 19:08:50 UTC
Permalink
Post by DigitalGod
Hello All,
I want to search for different things in the Linux Kernel Source tree.
I know I can use grep but HOW do I get grep to search through EVERY
Directory and FILE to find then text I am looking for INSIDE the
Source files? Exa... main();
Read the grep(1) manpage ("man 1 grep") and look for the -R (or -r
or --recursive) option. You want something like
grep -R 'main();' /usr/src/linux

HTH
--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
DigitalGod
2008-05-01 08:52:57 UTC
Permalink
On Wed, 30 Apr 2008 15:08:50 -0400, Lew Pitcher
Post by Lew Pitcher
Post by DigitalGod
Hello All,
I want to search for different things in the Linux Kernel Source tree.
I know I can use grep but HOW do I get grep to search through EVERY
Directory and FILE to find then text I am looking for INSIDE the
Source files? Exa... main();
Read the grep(1) manpage ("man 1 grep") and look for the -R (or -r
or --recursive) option. You want something like
grep -R 'main();' /usr/src/linux
HTH
Hello,
This worked PERFECT!! Thanks a bunch. Another thing to add to MY LINUX
Bible.

Trevor Hemsley
2008-04-30 21:38:31 UTC
Permalink
On Wed, 30 Apr 2008 18:38:12 UTC in comp.os.linux.questions, DigitalGod
Post by DigitalGod
Hello All,
I want to search for different things in the Linux Kernel Source tree.
I know I can use grep but HOW do I get grep to search through EVERY
Directory and FILE to find then text I am looking for INSIDE the
Source files? Exa... main();
I had grep finding every instance of main.c BUT it never looked INSIDE
the files.
find /usr/src/linux -type f -print0 | xargs -0 grep -i string
--
Trevor Hemsley, Brighton, UK
Trevor dot Hemsley at ntlworld dot com
Continue reading on narkive:
Loading...