GREP and the KERNEL.

This is a discussion on GREP and the KERNEL. within the Questions forums, part of the Help category; 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 ...

Go Back   Unix Linux Forum > Unix > Linux > Help > Questions

FixUnix.com - Unix Linux Forums

Unix Content Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 04-30-2008, 02:38 PM
Default GREP and the KERNEL.

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
Reply With Quote
  #2  
Old 04-30-2008, 03:08 PM
Default Re: GREP and the KERNEL.

In comp.os.linux.questions, DigitalGod wrote:

> 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. ------


Reply With Quote
  #3  
Old 04-30-2008, 05:38 PM
Default Re: GREP and the KERNEL.

On Wed, 30 Apr 2008 18:38:12 UTC in comp.os.linux.questions, DigitalGod
wrote:

> 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
Reply With Quote
  #4  
Old 05-01-2008, 04:52 AM
Default Re: GREP and the KERNEL.

On Wed, 30 Apr 2008 15:08:50 -0400, Lew Pitcher
wrote:

>In comp.os.linux.questions, DigitalGod wrote:
>
>> 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.
Reply With Quote
Reply

Thread Tools


All times are GMT -5. The time now is 07:06 AM.

In an effort to better serve ads to our visitors, cookies are used on Fixunix.com. For more information, check out our Privacy Policy.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Ad Management by RedTyger