Linux grep option, linuxgrep Option

Source: Internet
Author: User

Linux grep option, linuxgrep Option

Grep-I disable case sensitivity

Grep-v print all does not contain .. (Some entries are blocked)

Grep-l print the file name in the inclusion Mode

Grep-c prints the number of rows containing the pattern,

Grep-w: print the words in the inclusion Mode


The R Command Option of grep on linux

It has no meaning. It is used for recursion. If there is no sub-directory, it automatically ignores this parameter.

List the main options and functions of the linux grep command

Grep parameters:
1. grep-c option file: displays the number of lines in the file that contain the search content. For example, the preceding command indicates the number of lines in the file that contain the option content.
2. grep-n option flie: Lists All matched rows and adds the number of sequences of rows at the beginning.
3. grep-v option file: displays the number of lines in the file that do not contain the searched content. This is the opposite of the-c parameter.
4. gep-I option file: Lists matching rows of the searched content. The search process is case insensitive.
5. grep-l option *: lists the names of all files containing option content.
6. grep-r option: Search the current directory and all subdirectories.
7. grep-w option file: exact search, accurate search, for example, grep-w B * a.txt, is a * character.
8. grep-x option file: Completely matches the output. For example, grep-x hello a.txt only outputs a row containing the hello string, and this row only contains the hello content. Assume that there is a line "hello all" in a.txt. If you execute the preceding command, this row will not be searched.

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.