Mail Archives: djgpp/1997/10/14/13:32:47

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: <>
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) ?

	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

- Raw text -

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