The GREP_V1 of Linux commands

Source: Internet
Author: User

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

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.