Regular Expressions:
also called conventional notation. Regular expressions are described using a single string, matching a series of strings that conform to a given sentence plan, and regular expressions are often used to retrieve and replace text that conforms to a pattern.
*******************************************************************************************
Grep:
The grep command in a Linux system is a powerful text search tool that can use regular expressions to search for text and print matching lines, using permissions for all users.
Use format: grep [option]
Main parameters:[option]
-C: Output only the number of rows matching rows
-I: Case insensitive (only for single-character)
-H: Do not display file names when querying multiple files
-L: Only file names with matching characters are output when querying multiple files
-N: Display matching lines and line numbers
-S: Do not display error messages for nonexistent or no matching text
-V: Displays all lines that do not include matching text
Pattern Regular Expression Main parameters:
\: Ignores the original meaning of special characters in regular expressions
^: match the start line of the regular expression
$: Match the end line of a regular expression
\<: Starting with the line that matches the regular expression
\>: End of line to match regular expression
[]: A single character, such as [a] that a meets the requirements
[-]: range, e.g. [A-z], i.e. a,b,c until Z meets requirements
。 : All the individual characters
*: With characters, length can be 0
650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M01/3E/E5/wKioL1PH_vahPgWcAAA334l8wu0148.jpg " Title= "Qq20140718004501.png" style= "Float:left; alt=" Wkiol1ph_vahpgwcaaa334l8wu0148.jpg "/>
The number of rows with the ' root ' character in the output/etc/passwd file, which is 2
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/3E/E5/wKiom1PH_m6ABmF4AABV4v_ab9Y375.jpg "title=" Qq20140718004826.png "alt=" Wkiom1ph_m6abmf4aabv4v_ab9y375.jpg "/>
Outputs all rows with ' root ' characters in the/etc/passwd file, and displays the number of rows per line, divided into 1, 11
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/3E/E5/wKioL1PIAN-AYTosAABIBpK5UNc851.jpg "title=" 11.png "alt=" Wkiol1pian-aytosaabibpk5unc851.jpg "/>
Displays all lines in the/etc/passwd file that do not contain the ' HUNGSS ' character
Displays all lines in the/etc/shadow file that do not contain the ' root ' character
This article is from the "Not So Simple" blog, be sure to keep this source http://hungss5657.blog.51cto.com/8011603/1439758