Linux-grep Command __linux

Source: Internet
Author: User
grep Command Brief Introduction

Used to find a file that contains the specified template style, and if the content of a file is found to fit the specified template style, the preset grep instruction displays the column that contains the template style. Grammar

[Root@www ~]# grep [-ACINV] [--color=auto] ' search string ' filename

Options and Parameters:
-A: binary files are searched for data in the form of text files
-C: Calculates the number of ' search strings ' found
-I: Ignores case differences, so capitalization is considered the same
-N: By the way output line number
-V: Reverse selection, which shows the line with no ' search string ' content
-Q: Do not display any information.
–color=auto: You can expand grep (GREP-E or Egrep) by adding a color to the part of the keyword you find:

The main benefit of using extended grep is the addition of additional regular expression meta sets. Example 1. Print all rows that contain root or Feng

# egrep ' Root|feng '/etc/passwd

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.