How do I combine multiple grep commands?

Another option:

... | grep -v -e @param -e @return -e @Test -e @throws

You can use:

... | grep -v "\(@param\|@return\|@Test\|@throws\)"

or you can use the -E flag to enable extended regular expressions, which will allow you to avoid escaping the parentheses and pipe characters:

... | grep -Ev '(@param|@return|@Test|@throws)'

Alternatively, you can place all your patterns in a file, one pattern per line, and use

... | grep -v -f matches.txt

Would make things easier if you use the patterns regularly

Tags:

Bash

Grep