| -E |
If this option is added, then the subsequent match pattern is the extended regular expression, which is grep-e = Egrep |
| -I. |
Ignore case differences when comparing characters |
| -W |
The expression as a word to find, equivalent to the regular "<...>" (... Represent your custom rules) |
| -X |
The content that is matched is exactly the entire line, which is equivalent to the regular "^...$" |
| -V |
Reverse, that is, the output of the opposite of our definition of the pattern |
| -C |
Count. Statistics, count the number of rows that match the result, mainly not the number of matches, is the number of rows. |
| -M |
Matches only the specified number of rows, after which the content is not matched |
| -N |
Display the line number in the output, it is clear here that the so-called line number is the line number of the line content in the original file, rather than the output result of the row number |
| -O |
Only matches are displayed, and grep defaults to displaying a row that satisfies the match criteria, plus this parameter shows only the matching results, for example, if we want to match an IP address, we only need the result, not the contents of the line. |
| -R |
Recursive matching. If you want to match content in multiple files or directories in a directory, you need this parameter |
| -B |
The output satisfies the first few lines of the condition row, such as the Grep-b 3 "AA" file, which indicates that a row with a AA is output in file, and the first 3 rows of the AA are also output |
| -A |
This is similar to-B, where the output satisfies the following lines of the condition row |
| -C |
This is equivalent to the simultaneous use of-b-a, that is, both front and rear output |