Skip to main content

grep is a Unix command-line utility that searches input for lines matching (or not) a regular expression and prints the results.  Use this tag for questions about how to use grep features, how to write regular expressions that work with grep, and general usage.  Because grep is now available in Unix-like environments (e.g., Cygwin on Windows), you can also use this tag for compatibility questions, and differences between versions and software environments.

grep is a Unix command-line utility that searches input passed to it for lines (or NUL-terminated records) matching (or not matching) a regular expression (or regular expressions), 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 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