grep
is a Unix command-line utility whichthat searches input passed to it for lines (or NUL-terminated records) matching (or not matching) a regular expression (or regular expressionexpressions), and prints the results. As is typical for Unix command-line utilities, it can take input from files and/or read the standard input.
Usage
Use this tag for questions about how to use grep
features, how to write regular expressions that work with grep
, and general usage. Because Because grep
is now available in Unix-like environments (including Cygwin on Windows), you can also use this tag for compatibility questions, and differences between versions and software environments.
Related tags
References
- Man page
- POSIX specification
- GNU grep manual
Note that the GNU version ofgrep
, which is commonly included with Linux systems, has options / features not specified by POSIX.