[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Grep Options
- From: Bret Hughes <bhughes elevating com>
- To: redhat-list redhat com
- Subject: Re: Grep Options
- Date: Sun, 02 Jul 2000 02:30:16 -0500
SoloCDM wrote:
> While using grep, what is the best way to search for two subjects
> within the same line instead of the following?
>
> cat <filename> | grep <subject_one> | grep <subject_two>
>
> This is not an "or" search with "-e", but an "and" search.
something like :
grep subject1.+subject2 filename
I belive this say grep all lines in filename that have the text subject
on followed by one or more of any character followed by the text
subject2.
I forget off hand how to tell it zero or more of any character. The
above will not grep a line like "subject1subject2" but would get
"subject1 subject2"
Bret
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]