# 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