delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/08/07/11:56:09

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
From: Adam Dinwoodie <Adam DOT Dinwoodie AT metaswitch DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: problem using recursive grep (-r option)
Date: Tue, 7 Aug 2012 15:53:39 +0000
Deferred-Delivery: Tue, 7 Aug 2012 15:53:00 +0000
Message-ID: <CE9C056E12502146A72FD81290379E9A43657DF0@ENFIRHMBX1.datcon.co.uk>
References: <34266659 DOT post AT talk DOT nabble DOT com>
In-Reply-To: <34266659.post@talk.nabble.com>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id q77Fu60Z027753

AngusC wrote:
>If I use the command:
>
>grep -nH -r "my pattern" *.*
>
>I get results back as expected
>
>But if the file pattern is like this:
>
>grep -nH -r "my pattern" *.log
>
>I get no results back (Even though I have a ton of files with this pattern
>with .log file extension).
>
>Am I doing something wrong?

Yes.

At a guess, all your .log files are in subdirectories that don't match *.log.
I'd recommend using `find`. Running `man find` will give you some instructions,
as will Google.

That said, you've not given any indication as to why your problem is
specifically relevant to Cygwin. There're plenty of places to get general help
with using Linux tools, but this isn't one of them -- this list is for problems
that are specific to Cygwin. I'd personally recommend heading over to Stack
Overflow or Super User, but there're *many* alternatives for advice on using
generic Linux tools.

If you do want advice from here, I recommend reading and following the
instructions at <http://cygwin.com/problems.html>. Folk here tend to be much
more accommodating if you show you've done the basic research yourself.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019