Skip to content

grep multiple search patterns

We need to get the line: starting with "["; containing "5060"; containing "conv".

Example usage:

cat gateway.cfg | grep '^\[\|5060\|conv'

or

cat gateway.cfg | egrep '^\[|5060|conv'

If we need to get lines with one of our patterns - use grep -e option. Example:

grep -e "test" -e "second pattern" -e "third pattern"

 

Leave a Reply

Your email address will not be published. Required fields are marked *

π