Other Options (GNU Grep 3.7)
2.1.7 Other Options
Delimit the option list. Later arguments, if any, are treated as operands even if they begin with ‘
-’. For example, ‘
grep PAT -- -file1 file2’ searches for the pattern PAT in the files named
Use line buffering for standard output, regardless of output device. By default, standard output is line buffered for interactive devices, and is fully buffered otherwise. With full buffering, the output buffer is flushed when full; with line buffering, the buffer is also flushed after every output line. The buffer size is system dependent.
On platforms that distinguish between text and binary I/O, use the latter when reading and writing files other than the user’s terminal, so that all input bytes are read and written as-is. This overrides the default behavior where
grepfollows the operating system’s advice whether to use text or binary I/O. On MS-Windows when
grepuses text I/O it reads a carriage return–newline pair as a newline and a Control-Z as end-of-file, and it writes a newline as a carriage return–newline pair.
When using text I/O
-b) counts and
--binary-filesheuristics apply to input data after text-I/O processing. Also, the
--binary-filesheuristics need not agree with the
--binaryoption; that is, they may treat the data as text even if
--binaryis given, or vice versa. See File and Directory Selection.
This option has no effect on GNU and other POSIX-compatible platforms, which do not distinguish text from binary I/O.
Treat input and output data as sequences of lines, each terminated by a zero byte (the ASCII NUL character) instead of a newline. Like the
--nulloption, this option can be used with commands like ‘
sort -z’ to process arbitrary file names.