Title: Use of the grep command
role:grep can parse a line of text, get the keyword, if the row has a keyword, will be the whole row out.
grep [-ACINV] [--color=auto] ' Find string ' filename
First, the parameters
-A: binary files are searched for data in text mode
-C: Calculates the number of rows found matching a string
-I: Ignoring case differences, all case is considered the same
-N: Output line number
-O: Output only strings on matching
-V: Reverse selection, which shows the line without the "Find string" content
--color=auto: You can add a color display to the Found keyword section
Second, examples
Example 1: Finding all files in a directory that contain a specified string
Grep-n ' the './*
Example 2: Finding rows that contain tuse and test strings
Grep-n ' t[ue]st ' filename
Example 3: Finding blank lines and non-empty rows
Grep-n ' ^$ ' filename
Example 4:grep-v ' ^$ ' filename
grep for common commands of Linux