Re: Slightly OT: How to grep for two different things in a file

From: Steve O'Hara-Smith <steve_at_sohara.org>
Date: Thu, 08 Sep 2022 06:31:16 UTC
On Wed, 07 Sep 2022 20:43:21 -0700
Carl Johnson <carlj@peak.org> wrote:

> I use grep -l to just return a list of files that contain one pattern,
> and then grep -l for the second pattern on that list.  That can be done
> in one line for your example as follows:
> 
>   grep -li /tmp `grep -liR tid src/java`

	This fails in the presence of filenames with spaces, which is a
pity because it is very elegant.

-- 
Steve O'Hara-Smith <steve@sohara.org>