Grep 2 or more words

Discussion in 'Site & Server Administration' started by lbalance, Feb 6, 2009.

  1. #1
    I need to search for files that contain 2 specific words. Some cases I'll need to do 3.

    It needs to be AND and not OR.

    What I have so far is
    find . -exec grep -q "searchterm" '{}' \; -print
    Code (markup):

    * It needs to search the entire contents of a file, not 2 terms on 1 single line *

    This works great for searching 1 word. How can I add another term?

    Thanks
     
    lbalance, Feb 6, 2009 IP