The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
How to grep for two or more words in a line at the same time?
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
How to grep for two or more words in a line at the same time?
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
02-28-2006
Ygor
Moderator
Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,258
Perhaps use an extended regular expression...
Code:
egrep '(file.*testfile|testfile.*file)' file*
Ygor
View Public Profile
Find all posts by Ygor