Link to home
Start Free TrialLog in
Avatar of bt707
bt707Flag for United States of America

asked on

grep command two patterns

can't get this right for some reason:

I want to do a search for any line that contains two differnt items, must contain both, when I do a search I still get all lines that
contain one or the other or both, I want only the lines that contain Both.

Ex:

I use this command and it works but gives me all lines that contain either word.

grep 1stWord 2ndWord -e file1


Thanks,

ASKER CERTIFIED SOLUTION
Avatar of griessh
griessh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bt707

ASKER

that did it, thanks a lot