GREP and the KERNEL. - Questions

This is a discussion on GREP and the KERNEL. - Questions ; 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 ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: GREP and the KERNEL.

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

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



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

  4. 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 to Thread