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