Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grep & regex

Status
Not open for further replies.

PaulBarbeau

Programmer
Nov 23, 2000
109
CA
I am having problem locating a file with GREP and Regex can some help with the the line. I want to look for all files that have paul but not john in them.

Thanks for any help
 
The basic command is [tt]grep -l[/tt] which lists filenames containing matches

1. All text files containing paul
[tt]files=`grep -l paul *.txt`[/tt]

2. All the previous files not containing john
[tt]grep -v -l john $files[/tt]

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top