grep can search for lines that don’t include word with the
-v flag. We can use
-e to search for multiple words, but this can be a pain when there’s a lot to search for.
-f flag allows us to specify a file that contains a list of words/phrases to search for (one on each line) which makes it much easier to read.
grep -v -e "phrase one" -e "phrase two" -e "phrase three" <filename>
Can be rewritten as follows:
grep -v -f words.txt <filename>
words.txt looks like:
phrase one phrase two phrase three
-v flag would search for only the words in the file.