Linux grep Common parameters

Source: Internet
Author: User

# grep [-ACINV] [--color=auto] ' search string ' filename
Options and Parameters:
-C: Calculates the number of ' search string ' found
-I: Ignores case differences, so case is considered the same
-N: Output line number by the way
-V: Reverse selection, which shows the line without the ' search string ' content

=========================

Cases:

-C: Calculates the number of ' search string ' found

[Email protected] ~]# CAT/ETC/PASSWD | grep Apache-C1

-I: Ignores case differences, so case is considered the same

[Email protected] ~]# CAT/ETC/PASSWD | grep APACHE-iapache:x: $:Apache:/usr/share/httpd:/sbin/nologin

-N: Output line number by the way

[Email protected] ~]# CAT/ETC/PASSWD | grep Apache-n: apache:x: $: Apache:/usr/share/httpd:/sbin/nologin

-V: Reverse selection, which shows the line without the ' search string ' content

[Email protected] ~]# cat/etc/httpd/conf/httpd.conf | Grep-n-V"#"| Head-n - -: to: ServerRoot"/etc/httpd" +: the: Listen the +: About: Include CONF.MODULES.D/*. Conf57:66:user apache67:group apache68:80:86:serveradmin [email protected]87:96:102:<directory/>103: AllowOverride none104:require all denied105:</directory>106:113:

Linux grep Common parameters

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.