Linux Study notes Sixth week first Class (March 12)

Source: Internet
Author: User
Tags egrep
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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.