[Top][All Lists]

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

Re: bug in grep

From: Waclaw Kusnierczyk
Subject: Re: bug in grep
Date: Fri, 08 Oct 2010 10:37:12 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100915 Thunderbird/3.0.8

On 10/08/2010 10:12 AM, Eric Blake wrote:
On 10/08/2010 03:39 AM, Piotr Karkuciński wrote:

I find bug in grep.

I create directory "--help"
Next I use command: grep -R "any string" *
and grep print help. Grep use directory name --help as parameter.

Thanks for the report. However, this is not a bug. See this related FAQ on the coreutils project:


Use either one of these alternatives instead:

grep -R "any string" ./*
grep -R "any string" -- *

Or, for that matter, since * in a large directory may exceed command line length limits on many OS, you may even want to consider using:

grep -R "any string" .

although that will also visit hidden dot-files in the current directory.

... which you can avoid by explicitly specify you don't want to visit them:

    grep -R --exclude='.*' "any string" .

or even

    grep -R --exclude='.*' --exclude-dir='.?*' "any string" .

if you don't want grep to consider hidden dot directories either.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]