--help | Output a help message, giving brief details of the command options and file type support, and then exit. | help + man |
-A, --after-context number | Output up to number lines of context after each matching line. | help + man |
-a, --text | Treat binary files as text. | help + man |
-B, --before-context number | Output up to number lines of context before each matching line. | help + man |
--binary-files word | Specify how binary files are to be processed. | help + man |
--buffer-size number | Set the parameter that controls how much memory is obtained at the start of processing for buffering files that are being scanned. | help + man |
--color option | matched text color option | help |
--colour option | If this option is given without any data, it is equivalent to "--colour=auto". | help + man |
-C, --context number | Output number lines of context both before and after each matching line. | help + man |
-c, --count | Do not output lines from the files that are being scanned; | help + man |
-D, --devices action | If an input path is not a regular file or a directory, "action" specifies how it is to be processed. | help + man |
-d, --directories action | If an input path is a directory, "action" specifies how it is to be processed. | help + man |
--posix-digit | \d always matches [0-9], even in UTF/UCP mode | help |
-E, --case-restrict | When case distinctions are being ignored in Unicode mode, two ASCII letters (K and S) will by default match Unicode characters U+212A (Kelvin sign) and U+017F (long S) respectively, as well as their… | help + man |
-e, --regex, --regexp pattern | specify pattern (may be used more than once) | help + man |
-F, --fixed-strings | Interpret each data-matching pattern as a list of fixed strings, separated by newlines, instead of as a regular expression. | help + man |
-f, --file path | Read patterns from the file, one per line. | help + man |
--posix-pattern-file | When patterns are provided with the -f option, do not trim trailing spaces or ignore empty lines in a similar way than other grep tools. | help + man |
--file-list path | Read a list of files and/or directories that are to be scanned from the given file, one per line. | help + man |
--file-offsets | Instead of showing lines or parts of lines that match, show each match as an offset from the start of the file and a length, separated by a comma. | help + man |
--group-separator text | Output this text string instead of two hyphens between groups of lines when -A, -B, or -C is in use. | help + man |
-H, --with-filename | Force the inclusion of the file name at the start of output lines when searching a single file. | help + man |
-h, --no-filename | Suppress the output file names when searching multiple files. | help + man |
-I | treat binary files as not matching (ignore) | help + man |
-i, --ignore-case | Ignore upper/lower case distinctions when pattern matching. | help + man |
-l, --files-with-matches | Instead of outputting lines from the files, just output the names of the files containing lines that would have been output. | help + man |
-L, --files-without-match | Instead of outputting lines from the files, just output the names of the files that do not contain any lines that would have been output. | help + man |
--label name | This option supplies a name to be used for the standard input when file names are being output. | help + man |
--line-buffered | When this option is given, non-compressed input is read and processed line by line, and the output is flushed after each write. | help + man |
--line-offsets | Instead of showing lines or parts of lines that match, show each match as a line number, the offset from the start of the line, and a length. | help + man |
--locale locale | This option specifies a locale to be used for pattern matching. | help + man |
--heap-limit number | set PCRE2 heap limit option (kibibytes) | help + man |
--match-limit number | Processing some regular expression patterns may take a very long time to search for all possible matching strings. | help + man |
--depth-limit number | set PCRE2 depth limit option | help + man |
-M, --multiline | Allow patterns to match more than one line. | help + man |
-m, --max-count number | Stop processing after finding number matching lines, or non-matching lines if -v is also set. | help + man |
-N, --newline type | Six different conventions for indicating the ends of lines in scanned files are supported. | help + man |
-n, --line-number | Precede each output line by its line number in the file, followed by a colon for matching lines or a hyphen for context lines. | help + man |
--no-jit | If the PCRE2 library is built with support for just-in-time compiling (which speeds up matching), pcre2grep automatically makes use of this, unless it was explicitly disabled at build time. | help + man |
--no-group-separator | Do not output a separator between groups of lines when -A, -B, or -C is in use. | help + man |
-O, --output text | When there is a match, instead of outputting the line that matched, output just the text specified in this option, followed by an operating-system standard newline. | help + man |
-o, --only-matching n | Show only the part of the line that matched a pattern instead of the whole line. | help + man |
--om-separator text | Specify a separating string for multiple occurrences of -o. | help + man |
--om-capture n | Set the number of capturing parentheses that can be accessed by -o. | help + man |
-P, --no-ucp | Starting from release 10.43, when UTF/Unicode mode is specified with -u or -U, the PCRE2_UCP option is used by default. | help + man |
-q, --quiet | Work quietly, that is, display nothing except error messages. | help + man |
-r, --recursive | If any given path is a directory, recursively scan the files it contains, taking note of any --include and --exclude settings. | help + man |
--exclude pattern | Files (but not directories) whose names match the pattern are skipped without being processed. | help + man |
--include pattern | If any --include patterns are specified, the only files that are processed are those whose names match one of the patterns and do not match an --exclude pattern. | help + man |
--exclude-dir pattern | Directories whose names match the pattern are skipped without being processed, whatever the setting of the --recursive option. | help + man |
--include-dir pattern | If any --include-dir patterns are specified, the only directories that are processed are those whose names match one of the patterns and do not match an --exclude-dir pattern. | help + man |
--exclude-from path | Treat each non-empty line of the file as the data for an --exclude option. | help + man |
--include-from path | Treat each non-empty line of the file as the data for an --include option. | help + man |
-s, --no-messages | Suppress error messages about non-existent or unreadable files. | help + man |
-t, --total-count | This option is useful when scanning more than one file. | help + man |
-u, --utf | Operate in UTF/Unicode mode. | help + man |
-U, --utf-allow-invalid | As --utf, but in addition subject lines may contain invalid UTF-8 code unit sequences. | help + man |
-V, --version | Write the version numbers of pcre2grep and the PCRE2 library to the standard output and then exit. | help + man |
-v, --invert-match | Invert the sense of the match, so that lines which do not match any of the patterns are the ones that are found. | help + man |
-w, --word-regex, --word-regexp | Force the patterns only to match "words". | help + man |
-x, --line-regex, --line-regexp | Force the patterns to start matching only at the beginnings of lines, and in addition, require them to match entire lines. | help + man |
--allow-lookaround-bsk | PCRE2 now forbids the use of K in lookarounds by default, in line with Perl. | help + man |
-Z, --null | Terminate files names in the regular output with a zero byte (the NUL character) instead of what would normally appear. | help + man |
--max-buffer-size number | This limits the expansion of the processing buffer, whose initial size can be set by --buffer-size. (in the manual page but not in --help) | man |
--recursion-limit number | This is an obsolete synonym for --depth-limit. (in the manual page but not in --help) | man |