Searches one or more
files for lines that match an extended regular expression
regexp. egrep doesn't support the regular expressions
\}, but does support the other expressions, as well as the extended set
(). Remember to enclose these characters in quotes. Regular expressions are described in Chapter 6. Exit status is 0 if any lines match, 1 if none match, and 2 for errors.
Search for occurrences of Victor or Victoria in
Find and print strings such as old.doc1 or new.doc2 in
files, and include their line numbers:
egrep -n '(old|new)\.doc?'