1, the purpose of the command: used to search for text or a specified file in the specified string or pattern matches the line, the default is to display only matching rows.
2. Common parameters:
-I ignores case
-E matches multiple styles
-R or-R recursive search
-L OUTPUT The file name of the matching row
-W force matches the specified string
The number of times that the-C statistic matches
-N Displays the line number of the line that matches to
-V opposite match output
--include contains a lookup for some file types
--exclude exclude certain file types from finding
--color will match to the color to mark out
3, the command usually with the regular expression, pipe symbol "|" Use, play a powerful effect.
4. Example (Update supplement):
Eg1:cat Scarecrow >test.txt | Grep-e "Care"-e "crow"
Eg2:grep "Main ()". -R--include *. {C,cpp,py}
This article is from the "learning diligence for the Boat" blog, please be sure to keep this source http://bluecountry.blog.51cto.com/9602056/1690010
The GREP_V1 of Linux commands