Grep is a handy Unix/Linux command for searching for lines in files that containg a particular string. Example:
grep "cat" fooprints all lines of file "foo" that contains "cat".
Do a web search for "grep" to get a full manual.
However, one subtlety is not clear to me from the man page or online manuals.
To print lines that contain either "red" or "blue", type
grep "red\|blue" fooNotice the backslash ("\") before the infix ("|") symbol. Without this, it does not work.