grep and egrep

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

  1. The problem statement, all variables and given/known data:
    I have a text file.
    1) How do I search for x and y?
    'Find all lines that contain David and Emily'

2) How do I search for not X?
'Find all lines that doesn't end with Caine'

3)
'Find lines that start with Yowwww (arbitrary number of w's) and contains Emily somewhere afterwards

  1. Relevant commands, code, scripts, algorithms:

none

  1. The attempts at a solution (include all code and scripts):

I thought you could use the and conditional by typing
egrep 'David && Emily' fileName

I thought you you searched for a file not ending with 'Caine' by typing
egrep '[Caine$]' fileName

  1. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
    University of Texas
    Austin
    United States
    Erozner
    CS108
    cs.utexas.edu/~erozner/cs108/

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).

For David and Emily.

 
egrep David Filname | egrep 'Emily'

For excluding a match, use the -v option, which is negation.