problem using recursive grep (-r option)
AngusC
anguscomber@gmail.com
Tue Aug 7 17:19:00 GMT 2012
Why would I use find . -name "*.log" -exec grep -nH "my pattern" \{\} \;
which is much longer to type when I can use grep ... -r ???
marco atzeri-4 wrote:
>
> On 8/7/2012 5:08 PM, 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?
>>
>
> in the second case the "-r" is looking for *.log
> file or directories and I guess the directory does not match.
>
> Try
>
> find . -name "*.log" -exec grep -nH "my pattern" \{\} \;
>
> Regards
> Marco
>
> --
> 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
>
>
>
--
View this message in context: http://old.nabble.com/problem-using-recursive-grep-%28-r-option%29-tp34266659p34267373.html
Sent from the Cygwin list mailing list archive at Nabble.com.
--
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
More information about the Cygwin
mailing list