Grep

    Invert match on multiple words

    echo "hello world" | grep -vE 'hello|foo'  #
    echo "only bar" | grep -vE 'hello|foo'  # only bar
    

    Basics

    Show the filename containing pattern

    grep -l 'pattern' file.txt
    

    Show the filename and line

    grep -Hn 'pattern' file.txt
    

    Only first pattern

    grep -m 1 'pattern' file.txt
    

    Invert match

    grep -v -E 'dont_want_that_pattern|neither_this' file.txt