|
From: | Paolo Bonzini |
Subject: | Re: Grep has a Bug with recursive-option and file-pattern |
Date: | Wed, 06 Jan 2010 09:11:48 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0 |
On 01/05/2010 06:36 PM, Asis Hallab wrote:
Good day! The following example should explain it: # First grep returns no result. : grep -lr "oligarchy" *.txt # Second one ignoring the txt-file-pattern, does!: ~/Documents$ grep -lr "oligarchy" *tmp/test.txt
This is not how grep -r works. In the first case, grep -r looks for "*.txt" in the current directory only.
What you want is grep --include=*.txt -lr oligarchy . Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |