About grep
As described in the man file for Linux:
grep searches the named input FILEs (or standard input if no files are named, or if a single hyphen-minus (-) is given as file name) for lines containing a match to the given PATTERN. By default, grep prints the matching lines. In addition, two variant programs egrep and fgrep are available. egrep is the same as grep -E. fgrep is the same as grep -F. Direct invocation as either egrep or fgrep is deprecated, but is provided to allow historical applications that rely on them to run unmodified.
grep is a command used to find rows in a file that matches a given pattern, while both Egrep and fgrep have been deprecated and replaced by GREP-E and Grep-f.
Using methods to search a single file for rows that contain strings
Grammar:
grep "literal_string" filename
Searching for rows containing strings in multiple files
Grammar:
grep "This" demo_*
Note: This search domain is a file prefixed with Demo_
Use the-I parameter to enable case-insensitive use of regular expressions to filter
Grammar:
grep "REGEX" filename
Specific use of the method can be consulted: http://www.cnblogs.com/kuyuecs/archive/2012/07/13/2589988.html
Well-written blog.
grep common usage