To grep multiple patterns with space in between them......

Hii... Every One......

I want to grep multiple patterns with space in between them.
For eg : I have a file which contains following :

red cat
every one
new one
you are
an ox
take one

Now, what I want to do is to grep " you are" , "an ox" and "red cat" from this file.
Any help.....
Thanks in advance......

Use egrep:

egrep "you are|an ox|red cat" file 

Easy way - if you have a pre-defined list of search terms ("you are", "an ox" and "red cat"), you can place them into a text file (call it something meaningful - I'll use "check" for this example.

egrep -f check longfile_with_lots_of_text

The -f argument tells egrep to take the list of full regular expressions from "check". It'll check for each line.

This case will find "an ox", "an ox is blue", "an ox is red", "red cat", "red cathedral", etc.

Thanks It's working......

Another one:

awk '/you are|an ox|red cat/ { print; }' file

Thanks....