Linux: grep command Detailed

[Reference] article:

  grep (global search regular expression (RE) and print out the line, comprehensive search regular expression and print out the line) is a powerful text search tool, you can use a regular expression search text, and print the matching lines come out.

1. Usage

  grep [option] ... PATTERN [FILE] ...

2. parameter options

2.1 Regular Expressions selection and interpretation

  -E, --extended-regexp PATTERN is an extended regular expression (abbreviated as the ERE)
  -F, --fixed the PATTERN-strings is a set of fixed strings separated by line breaks.
  -G, --basic-regexp PATTERN is a basic regular expression (abbreviated as BRE)
  -P, - Perl-regexp PATTERN is a Perl regular expression
  -e, --regexp = PATTERN PATTERN used to perform a matching operation
  - w, --word-regexp force PATTERN only the exact match
  -x, --line-regexp force PATTERN fully matched line

  -f, --file = FILE acquired from the FILE the PATTERN
  -i, --ignore-Case Ignore case
  -z, --null-data of a 0-byte data row, but not the blank line

2.2 Output Control

2.3 Document control

Guess you like

Origin www.cnblogs.com/virgosnail/p/12158263.html