Friendly tip: Linux command operations are case-sensitive!
Grep's Full English name: Global search REgular expression and Print out of the line.
The text content search tool searches the target file on a row-by-line basis based on user-specified text patterns (regular expression metacharacters and normal characters) to display rows that can be matched.
Introduction to How to use:
grep [OPTIONS] PATTERN [FILE ...]
Example: Grep-i ' abc '/home/love.txt
The [options] option describes:
-I search is not case-sensitive
-O shows only what is matched to the pattern
-V shows rows that cannot be matched to a pattern
-e using extended regular expressions
--color match to the inside to set the color
--color=[auto|always|never ...]
Color Example: grep--color=auto "Root"/etc/passwd
Pattern Matching mode Description:
' Name ' character form, match as-is
' [0-9][a-z] ' regular match. Do not understand the degree of the mother is the article.
Regular: Basic regular, extended regular.
grep ' \ (abc\) \+ '/home/love.txt basic regular usage mode.
Grep-e ' (ABC) + '/home/love.txt is required with the "-e" option to use the extension.
[FILE ...] Text content Description:
/home/love.txt How to find the path to text
echo ' abc ' | grep--color=auto ' ABC ' transmits text content in a "pipe" way. Pipeline do not understand please niang pipe article.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Egrep with grep, you do not need to add the "-e" option when using the extended regular.
Big rookie wish: a higher level. Welcome to the Big Rookie 3 group: 264723618
This article is from the "Big rookie Linux" blog, make sure to keep this source http://58dream.blog.51cto.com/10078511/1628965
Use of the Linux egrep grep command