Using grep with regular expression to filter out matches

The problem is that by default, you need to escape your |’s to get proper alternation. That is, grep interprets “foo|bar” as matching the literal string “foo|bar” only, whereas the pattern “foo\|bar” (with an escaped |) matches either “foo” or “bar”. To change this behavior, use the -E flag: tail -f logFile | grep -vE …

Read more