Get lines which has pattern1, pattern2 and pattern3 in it

Version: RHEL 6.5

In the below text file, I want to find the lines which has the string JOHN , KATE and STEVE in it.
The logic is to grep with an AND condition ie. get all lines with JOHN AND KATE AND STEVE

$ cat sometext.txt
PHILIP worked in HR
JOHN along with KATE fixed several IT issues. But, Steve got all the credit
JOHN worked in IT Department
KATE worked in the IT Department
STEVE worked in IT department

expected output:
JOHN along with KATE fixed several IT issues. But, Steve got all the credit

The following will work. But I need to grep multiple times. Is there another quick way using grep,egrep, awk, sed , ...etc ?

$ cat sometext.txt | grep -i JOHN | grep -i KATE| grep -i STEVE
JOHN along with KATE fixed several IT issues. But, Steve got all the credit

Hello John K,

Following may help you in same.

 awk '{match($0,/JOHN.*KATE.*Steve.*/);VAL=substr($0,RSTART,RLENGTH);if(VAL){print VAL}}'  Input_file
 

Output will be as follows.

 JOHN along with KATE fixed several IT issues. But, Steve got all the credit
 

Thanks,
R. Singh

Might not be the most elegant solution:

awk '{T=toupper($0)} T ~ /JOHN/ && T ~ /KATE/ && T ~ /STEVE/ ' file
JOHN along with KATE fixed several IT issues. But, Steve got all the credit

If you want them in the same order (as in your example):

grep -i 'JOHN.*KATE.*STEVE' sometext.txt

If you want them in any order:

awk '/[Jj][Oo][Hh][Nn]/ && /[Kk][Aa][Tt][Ee]/ && /[Ss][Tt][Ee][Vv][Ee]/' sometext.txt

Note that with your code (and either of the above) "skate" will be accepted as a match for KATE and "Stevenson" will be accepted as a match for STEVE. So, if you don't want:

Last winter, Johnny skated on the Stevens lake reservoir.

to be selected, you need to clarify your requirements.

If pattern order does not matter.

perl -nle '/JOHN/i and /KATE/i and /STEVE/i and print' sometext.txt

Using pattern order.

perl -nle '/JOHN.*KATE.*STEVE/i and print' sometext.txt

/i is for case insensitive, remove if case matters.