linux-Configuration String-grep

Source: Internet
Author: User

Grep-rn "hello,world!" *

*: represents all files in the current directory, or it can be a file name

-R is recursive lookup

-N is the line number displayed

-R Find all files containing subdirectories

-I ignores case

Here are some interesting command-line arguments:

Grep-i pattern Files: Search by case-insensitive. The default case is case-sensitive,

grep-l pattern Files: Lists only the matching file names,

Grep-l pattern Files: Lists mismatched file names,

Grep-w pattern files: matches only the entire word, not part of the string (such as matching ' magic ', not ' magical '),

grep-c number pattern files: matching contexts display [number] lines, respectively,

grep pattern1 | PATTERN2 files: Displays rows that match pattern1 or pattern2.

grep pattern1 Files | grep pattern2: Displays rows that match both PATTERN1 and pattern2.

linux-Configuration String-grep

Related Article

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.