Linux grep command

Source: Internet
Author: User

The grep command is a powerful text-search tool in Unix-like systems, the full name of the global Regular expression Print, which represents the globally regular expression version, which is used by all users.

The command format is:

grep file

Common option is:

-I.--ignore- Case#忽略字符大小写的差别. -N--line-Number #在显示符合样式的那一行之前 that indicates the column number of the row. -R--recursive #此参数的效果和指定 "-d recurse "parameter is the same. -S--no-messages #不显示错误信息. -A--text #不要忽略二进制的数据. -a< Display lines >#除了显示符合范本样式的那一列之外, and displays the contents after the line. -b< Display lines >#除了显示符合样式的那一行之外 and displays the contents before the line. -C--Count #计算符合样式的列数. -c< Display lines >#除了显示符合样式的那一行之外, and displays the contents of the line before it. -D < action >#当指定要查找的是目录而非文件时, this parameter must be used, otherwise the grep command returns information and stops the action. -H--no-filename #在显示符合样式的那一行之前, does not indicate the name of the file to which the line belongs. -H--with-filename #在显示符合样式的那一行之前 that represents the name of the file to which the row belongs.

Regular expression:

^ matches the starting line of the regular expression to match the end line of the regular expression \< starts with the line that matches the regular expression \>-] range;

Linux grep command

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.