9.1 Regular Introduction on _grep
Egrep is the extension of grep, with all grep functions;
grep is used to filter the keywords;
-R Traverse All subdirectories
-V to reverse, meaning that in addition to the keywords in the row, the other lines show up;
9.2 grep in
' 0-9 ' means any number from 0 to 9;
' "^0-9" means any number other than 0 to 9;
' ^# ' denotes lines beginning with #;
^ Put in brackets inside ' [^ keywords] ', indicating non;
^ Put in front of the keyword ' ^ keyword ' to denote the beginning of the keyword;
9.3 grep under
' R.O ', the character "." Represents any one character;
' R*o ', the character "*" denotes any n characters;
'. * ' denotes all characters;
\ de-ideographic character;
{} curly braces denote the repeating range of the preceding character;
' O\{2\} ' represents two o;
GREP-E equivalent to Egrep;
grep ' o\{2\} ' passwd equivalent to Egrep ' o{2} ' passwd or grep-e ' o{2} ' passwd;
+ denotes 1 or more occurrences of the preceding character;
? Represents 0 or 1 times the preceding character; ' O? T ' means t or ot;
| Express or;
() represents a combined string;
Extended
Filter all the lines in the *.php document that contain eval in a directory
Grep-r--include= "*.php" ' eval '/data/
Linux Study notes Sixth week first Class (March 12)