95
95
standard input is always so treated.
101
By default, a file that contains a binary zero byte within the first 1024 bytes
102
is identified as a binary file, and is processed specially. (GNU grep also
103
identifies binary files in this manner.) See the \fB--binary-files\fP option
104
for a means of changing the way binary files are handled.
117
126
of \fInumber\fP is expected to be relatively small. However, \fBpcregrep\fP
118
127
guarantees to have up to 8K of following text available for context output.
129
\fB-a\fP, \fB--text\fP
130
Treat binary files as text. This is equivalent to
131
\fB--binary-files\fP=\fItext\fP.
120
133
\fB-B\fP \fInumber\fP, \fB--before-context=\fP\fInumber\fP
121
134
Output \fInumber\fP lines of context before each matching line. If filenames
122
135
and/or line numbers are being output, a hyphen separator is used instead of a
125
138
of \fInumber\fP is expected to be relatively small. However, \fBpcregrep\fP
126
139
guarantees to have up to 8K of preceding text available for context output.
141
\fB--binary-files=\fP\fIword\fP
142
Specify how binary files are to be processed. If the word is "binary" (the
143
default), pattern matching is performed on binary files, but the only output is
144
"Binary file <name> matches" when a match succeeds. If the word is "text",
145
which is equivalent to the \fB-a\fP or \fB--text\fP option, binary files are
146
processed in the same way as any other file. In this case, when a match
147
succeeds, the output may be binary garbage, which can have nasty effects if
148
sent to a terminal. If the word is "without-match", which is equivalent to the
149
\fB-I\fP option, binary files are not processed at all; they are assumed not to
128
152
\fB--buffer-size=\fP\fInumber\fP
129
153
Set the parameter that controls how much memory is used for buffering files
130
154
that are being scanned.
224
248
filename can be given as "-" to refer to the standard input. When \fB-f\fP is
225
249
used, patterns specified on the command line using \fB-e\fP may also be
226
250
present; they are tested before the file's patterns. However, no other pattern
227
is taken from the command line; all arguments are treated as file names. There
228
is an overall maximum of 100 patterns. Trailing white space is removed from
229
each line, and blank lines are ignored. An empty file contains no patterns and
230
therefore matches nothing. See also the comments about multiple patterns versus
231
a single pattern with alternatives in the description of \fB-e\fP above.
251
is taken from the command line; all arguments are treated as the names of paths
252
to be searched. There is an overall maximum of 100 patterns. Trailing white
253
space is removed from each line, and blank lines are ignored. An empty file
254
contains no patterns and therefore matches nothing. See also the comments about
255
multiple patterns versus a single pattern with alternatives in the description
258
\fB--file-list\fP=\fIfilename\fP
259
Read a list of files to be searched from the given file, one per line. Trailing
260
white space is removed from each line, and blank lines are ignored. These files
261
are searched before any others that may be listed on the command line. The
262
filename can be given as "-" to refer to the standard input. If \fB--file\fP
263
and \fB--file-list\fP are both specified as "-", patterns are read first. This
264
is useful only when the standard input is a terminal, from which further lines
265
(the list of files) can be read after an end-of-file indication.
233
267
\fB--file-offsets\fP
234
268
Instead of showing lines or parts of lines that match, show each match as an
255
289
Output a help message, giving brief details of the command options and file
256
290
type support, and then exit.
293
Treat binary files as never matching. This is equivalent to
294
\fB--binary-files\fP=\fIwithout-match\fP.
258
296
\fB-i\fP, \fB--ignore-case\fP
259
297
Ignore upper/lower case distinctions during comparisons.
485
523
Many of the short and long forms of \fBpcregrep\fP's options are the same
486
as in the GNU \fBgrep\fP program (version 2.5.4). Any long option of the form
524
as in the GNU \fBgrep\fP program. Any long option of the form
487
525
\fB--xxx-regexp\fP (GNU terminology) is also available as \fB--xxx-regex\fP
488
(PCRE terminology). However, the \fB--file-offsets\fP, \fB--include-dir\fP,
489
\fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP, \fB-M\fP,
490
\fB--multiline\fP, \fB-N\fP, \fB--newline\fP, \fB--recursion-limit\fP,
491
\fB-u\fP, and \fB--utf-8\fP options are specific to \fBpcregrep\fP, as is the
492
use of the \fB--only-matching\fP option with a capturing parentheses number.
526
(PCRE terminology). However, the \fB--file-list\fP, \fB--file-offsets\fP,
527
\fB--include-dir\fP, \fB--line-offsets\fP, \fB--locale\fP, \fB--match-limit\fP,
528
\fB-M\fP, \fB--multiline\fP, \fB-N\fP, \fB--newline\fP,
529
\fB--recursion-limit\fP, \fB-u\fP, and \fB--utf-8\fP options are specific to
530
\fBpcregrep\fP, as is the use of the \fB--only-matching\fP option with a
531
capturing parentheses number.
494
533
Although most of the common options work the same way, a few are different in
495
534
\fBpcregrep\fP. For example, the \fB--include\fP option's argument is a glob