On Sat, 18 Sep 2010 08:40:31 -0400 (EDT), Adam Borowski wrote: > On Sat, Sep 18, 2010 at 12:01:17PM +0100, Clive Standbridge wrote: >> Stephen Powell wrote: >>> Search all files under the home directory (recursively) with an >>> extension of .txt >>> for the keyword "xorg": >>> >>> grep -r xorg ~/*.txt >> >> That looks like a misunderstanding. That command actually causes grep >> to search >> (a) files matching *.txt in the home directory. >> (b) files of ANY name, contained in subdirectories named *.txt in the >> home directory. >> >> To search all files under the home directory (recursively) with an >> extension of .txt, you will need to use find .. | xargs or find >> .. -exec ... {} + as discussed previously, > > I guess you're looking for: > grep -r --include='*.txt' xorg ~
Clive, you are quite correct. I didn't think that through carefully enough. Thanks for pointing that out. And thanks to you, Adam, for the corrected version. -- .''`. Stephen Powell : :' : `. `'` `- -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/1732889826.116729.1284988319814.javamail.r...@md01.wow.synacor.com