| Unix Content | Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| 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
|
| 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
|
| On Wed, 30 Apr 2008 18:38:12 UTC in comp.os.linux.questions, 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 |
|
#4
|
| On Wed, 30 Apr 2008 15:08:50 -0400, Lew Pitcher >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. |