In case of xargs, a set of files is given as argument to grep, you can also specify the number of files to be given in each set.
e.g. find . -type f -iname "*.h" | xargs -n 50 grep 'test'
So in this case xargs will break down all the files into sets of 50. If there are 100 files found then there will be 2 invocations of grep.
On Thu, Nov 6, 2008 at 5:01 AM, Peter Teoh <htmldeveloper@xxxxxxxxx> wrote:
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
--
http://linuxexplained.blogspot.com