One, Grep:global searchregular expression and Print out of the line.
Text Filter tool (Pattern: pattern) Tool
(1) function:
1) Text Search Tool
2) match the target text line by row according to user-specified "mode (filter)";
3) print matches to the Whole Line text ;
(2) Pattern: The filter condition written by metacharacters and text characters of regular expressions;
mode through Regular expression engine Match Search
(3) format
grep [OPTIONS] PATTERN [FILE ...]
grep [OPTIONS] [-E PATTERN |-f file] [FILE ...]
OPTIONS:
--color=auto: Color The matching text to highlight;
-i:ignorecase, ignoring the case of characters;
-O: Displays only the string that matches to itself;
-V,--invert-match: Displays rows that cannot be matched by a pattern;
-E: Supports the use of extended regular expression metacharacters;
-Q,--Quiet,--silent: Silent mode, that is, do not output any information;
-a#:after, after # line
-b#:before, Front # line
-c#:context, front and back # lines
Second, Egrep: An extended regular expression implementation similar to the grep text filtering function; Grep-e
Egrep [OPTIONS] PATTERN [FILE ...]
Options:-i,-o,-V,-Q,-A,-B,-C
-G: support for basic regular Expressions
Third, Fgrep: Regular expression meta-characters are not supported;
When there is no need to use meta-characters to write patterns, the use of fgrep will be better;
In the data volume Super large text analysis is the speed manifest obvious
This article is from the "Xu Ding blog" blog, make sure to keep this source http://xuding.blog.51cto.com/4890434/1726587
Text Processing Three musketeers: grep