Re: how to ask grep to search specific file recurisively?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



may be i can contribute something:

/hdc1/download/2.6/linux-2.6-latest>git-ls-files -h
usage: git-ls-files [-z] [-t] [-v]
(--[cached|deleted|others|stage|unmerged|killed|modified])* [
--ignored ] [--exclude=<pattern>] [--exclude-from=<file>] [
--exclude-per-directory=<filename> ] [--full-name] [--abbrev] [--]
[<file>]*

from above, we know it has a "exclude" to exclude pattern-matched files:

this will list all C and *.S files, as well as documentation files:

git-ls-files --exclude=*.h

then u pipe it to grep.

/hdc1/download/2.6/linux-2.6-latest>git-ls-files --exclude=*.h | xargs
grep meme -
MAINTAINERS:M:  toshiba_acpi@xxxxxxxxxxxx
MAINTAINERS:W:  http://memebeam.org/toys/ToshibaAcpiDriver
arch/arm/mm/init.c:     unsigned long memend_pfn = 0;
arch/arm/mm/init.c:             if (end_pfn > memend_pfn)
arch/arm/mm/init.c:                     memend_pfn = end_pfn;
arch/arm/mm/init.c:     high_memory = __va(memend_pfn << PAGE_SHIFT);
arch/arm/mm/init.c:     max_pfn = max_low_pfn = memend_pfn - PHYS_PFN_OFFSET;

well...without using "find".

On Sat, Nov 1, 2008 at 5:09 PM, loody <miloody@xxxxxxxxx> wrote:
> 2008/11/1 Peter Teoh <htmldeveloper@xxxxxxxxx>:
>> "grep -r" is the way.
>>
>> if u use git, it is git-grep -r etc.   (git know where are all the C
>> files - via git-ls-files)
>>
> hi:
> actually I am tracing uclinux kernel source code, which I get it not from git.
> so~~
> As other friends suggest, I should use "find" to help me list out the
> files I want grep to search.
> thanks for your help,
> miloody
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>



-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux