Grep parameter, grep

Source: Internet
Author: User

Grep parameter, grep

Parameters:

-? At the same time, the upper and lower lines of matching rows are displayed? Line. For example, grep-2 pattern filename simultaneously displays the upper and lower two rows of matching rows.
-B, -- byte-offset: print the block number of the row before the matching row.
-C, -- count: only the number of matched rows is printed, and the matching content is not displayed.
-F File, -- file = File: extract the template from the File. The empty file contains 0 templates, so nothing matches.
-H, -- no-filename: when multiple files are searched, the matching file name prefix is not displayed.
-I, -- ignore-case ignore case differences.
-Q, -- quiet is not displayed. Only the exit status is returned. 0 indicates that the matched row is found.
-L, -- files-with-matches print the file list matching the Template
-L, -- files-without-match print the list of files that do not match the Template
-N, -- line-number Print the row number before the matched row
-S, -- silent does not display error messages about nonexistent or unreadable files
-V, -- revert-match: Only unmatched rows are displayed.
-W, -- word-regexp if it is referenced by \ <and \>, the expression is used as a word search.


Grep parameter problems

The grep has many versions, which comply with different specifications: the default value for Linux is GNU grep, and the previous commercial version of Solaris may be BSD grep or POSIX grep, I don't know which Solaris is...
The-o parameter allows grep to only display the part of the matching content in the matching row, rather than the content of the entire matching row...
It seems that you are studying other people's scripts, otherwise there will be no unknown parameters...

How does one explain the "l" parameter of the grep command in linux?

Only names containing matching characters are output.

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.