Filter the Three Musketeers for grep topics

Source: Internet
Author: User

1.1 Overview
grep is used primarily to find the lines of a keyword match
1.2 Basic syntax
1.2.1 Syntax
[[email protected] ~]# grep [parameters] Configuration mode file
1.2.2 Parameters
[[email protected] ~]# grep [parameters] Configuration mode file
Parameters
-I: Ignore case
-V: Take the inverse match
-W: Match word
--color Display Color

1.3 grep uses
[[email protected] ~]# grep root/etc/passwd filter out the root row in the passwd file
Root:x:0:0:root:/root:/bin/bash
Operator:x:11:0:operator:/root:/sbin/nologin
[[email protected] ~]# grep--color root/etc/passwd matching keywords display color
root: x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
[[email protected] ~]# grep-v root/etc/passwd Match Results reversed
Bin:x:1:1:bin:/bin:/sbin/nologin
Daemon:x:2:2:daemon:/sbin:/sbin/nologin

This article is from the "Lao Han Technical Note" blog, please be sure to keep this source http://hzyan.blog.51cto.com/9617993/1586571

Filter the Three Musketeers for grep topics

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.