OpenWindows Advanced User's Guide

4.1.4 More on grep

You can also use the grep command to search for targets defined as patterns using regular expressions. Regular expressions consist of letters and numbers, in addition to characters with special meaning to grep. These special characters, called metacharacters, also have special meaning to the system and need to be quoted or escaped. Whenever you use a grep regular expression at the command prompt, surround it with quotes, or escape metacharacters (such as & ! . * $ ? and \) with a backslash (\).