Grep parameter, grep
Parameters: |
-? At the same time, the upper and lower lines of matching rows are displayed? Line. For example, grep-2 pattern filename simultaneously displays the upper and lower two rows of matching rows. -B, -- byte-offset: print the block number of the row before the matching row. -C, -- count: only the number of matched rows is printed, and the matching content is not displayed. -F File, -- file = File: extract the template from the File. The empty file contains 0 templates, so nothing matches. -H, -- no-filename: when multiple files are searched, the matching file name prefix is not displayed. -I, -- ignore-case ignore case differences. -Q, -- quiet is not displayed. Only the exit status is returned. 0 indicates that the matched row is found. -L, -- files-with-matches print the file list matching the Template -L, -- files-without-match print the list of files that do not match the Template -N, -- line-number Print the row number before the matched row -S, -- silent does not display error messages about nonexistent or unreadable files -V, -- revert-match: Only unmatched rows are displayed. -W, -- word-regexp if it is referenced by \ <and \>, the expression is used as a word search. |
Grep parameter problems
The grep has many versions, which comply with different specifications: the default value for Linux is GNU grep, and the previous commercial version of Solaris may be BSD grep or POSIX grep, I don't know which Solaris is...
The-o parameter allows grep to only display the part of the matching content in the matching row, rather than the content of the entire matching row...
It seems that you are studying other people's scripts, otherwise there will be no unknown parameters...
How does one explain the "l" parameter of the grep command in linux?
Only names containing matching characters are output.