| delorie.com/archives/browse.cgi | search | 
| Date: | Tue, 14 Oct 1997 13:25:10 -0400 (EDT) | 
| From: | "Art S. Kagel" <kagel AT ns1 DOT bloomberg DOT com> | 
| Reply-To: | kagel AT ns1 DOT bloomberg DOT com | 
| To: | eyal DOT ben-david AT aks DOT com | 
| Cc: | eliz AT is DOT elta DOT co DOT il, djgpp AT delorie DOT com | 
| Subject: | Re: ANNOUNCE: Grep 2.1 uploaded | 
| In-Reply-To: | <42256530.003743EC.00@aks.com> | 
| Message-Id: | <Pine.D-G.3.96.971014120242.24870D-100000@dg1> | 
| Mime-Version: | 1.0 | 
On Tue, 14 Oct 1997 eyal DOT ben-david AT aks DOT com wrote:
> Thanks !
> Apropos grep,  I didn't find an option for 'grepping' also in
> subdirectories.
> Do I have to specify the dirs in the command line ?
> Is there any tool that does it  (with or without grep) ?
Try: 
	grep unistd.h *.c  */*.c  */*/*.c 
or more generally you can combine grep with find:
	find . -name '*.c' -exec grep unistd.h {} \; -print 
The filename will follow any matches and only those files that have
matches will be printed.  Moving the -print to before -exec prints the
names of all files checked each followed by any matches.
Art S. Kagel, kagel AT bloomberg DOT com
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |