I don't understand some basics..

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:
    1)find all lines in file ,myf that contain all the words cat dog and mouse in any order and start with the letter A
    2) list all fines in home dir that contain string "so " somewhere within them. next just list number of files in home dir that contain string so

  2. Relevant commands, code, scripts, algorithms:
    find
    ls

  3. The attempts at a solution (include all code and scripts):
    #1) egrep "cat|dog|mouse" myf -> would give all lines containing either cat dog or mouse , however i don't know how to start it with the letter A
    for #2) find . -name "so" ( however i now this is very off)
    thank you for the help

  4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
    ryerson , toronto , ontario , woit

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 the first question (as long you you have posted the question correctly), bear in mind that all the conditions must be statisfied.

The line must start with the letter "A".
The lne must contain the string "cat".
The line must contain the string "dog".
The line must contain the string "mouse".

One way is to progressively eliminate with "grep":

grep \^"A" myf | grep "cat" | grep "dog" | grep "mouse"

The egrep in your post will do an "or" not an "and".

For the second question, take a look at "grep -l" and for the second part of the question "wc -l".