[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to grep/manual/grep.html,v
From: |
Jim Meyering |
Subject: |
Changes to grep/manual/grep.html,v |
Date: |
Wed, 22 Mar 2023 22:55:24 -0400 (EDT) |
CVSROOT: /webcvs/grep
Module name: grep
Changes by: Jim Meyering <meyering> 23/03/22 22:55:22
Index: grep.html
===================================================================
RCS file: /webcvs/grep/grep/manual/grep.html,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- grep.html 3 Sep 2022 19:33:13 -0000 1.33
+++ grep.html 23 Mar 2023 02:55:19 -0000 1.34
@@ -1,11 +1,11 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd";>
+<!DOCTYPE html>
<html>
-<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
+<!-- Created by GNU Texinfo 7.0dev, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This manual is for grep, a pattern matching engine.
-Copyright (C) 1999-2002, 2005, 2008-2022 Free Software Foundation,
+Copyright © 1999-2002, 2005, 2008-2023 Free Software Foundation,
Inc.
Permission is granted to copy, distribute and/or modify this document
@@ -14,10 +14,10 @@
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the section entitled
"GNU Free Documentation License". -->
-<title>GNU Grep 3.8</title>
+<title>GNU Grep 3.10</title>
-<meta name="description" content="GNU Grep 3.8">
-<meta name="keywords" content="GNU Grep 3.8">
+<meta name="description" content="GNU Grep 3.10">
+<meta name="keywords" content="GNU Grep 3.10">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
@@ -30,21 +30,20 @@
<link href="#Introduction" rel="next" title="Introduction">
<style type="text/css">
<!--
-a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
-a.summary-letter {text-decoration: none}
-blockquote.indentedblock {margin-right: 0em}
+a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
+a.summary-letter-printindex {text-decoration: none}
+div.center {text-align:center}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
-kbd {font-style: oblique}
-pre.display {font-family: inherit}
-pre.format {font-family: inherit}
-pre.menu-comment {font-family: serif}
-pre.menu-preformatted {font-family: serif}
-span.nolinebreak {white-space: nowrap}
-span.roman {font-family: initial; font-weight: normal}
-span.sansserif {font-family: sans-serif; font-weight: normal}
-span:hover a.copiable-anchor {visibility: visible}
-ul.no-bullet {list-style: none}
+pre.display-preformatted {font-family: inherit}
+span.r {font-family: initial; font-weight: normal; font-style: normal}
+span:hover a.copiable-link {visibility: visible}
+td.printindex-index-entry {vertical-align: top}
+td.printindex-index-section {vertical-align: top; padding-left: 1em}
+th.entries-header-printindex {text-align:left}
+th.sections-header-printindex {text-align:left; padding-left: 1em}
+ul.mark-bullet {list-style-type: disc}
+ul.toc-numbered-mark {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css"
href="https://www.gnu.org/software/gnulib/manual.css";>
@@ -53,7 +52,6 @@
</head>
<body lang="en">
-<h1 class="settitle" align="center">GNU Grep 3.8</h1>
@@ -62,23 +60,23 @@
-<div class="top" id="Top">
-<div class="header">
+<div class="top-level-extent" id="Top">
+<div class="nav-panel">
<p>
Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up:
<a href="/manual" accesskey="u" rel="up">(dir)</a> [<a
href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a
href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
-<span id="grep"></span><h1 class="top">grep</h1>
+<h1 class="top" id="grep"><span>grep<a class="copiable-link" href="#grep">
¶</a></span></h1>
-<p><code>grep</code> prints lines that contain a match for one or more
patterns.
+<p><code class="command">grep</code> prints lines that contain a match for one
or more patterns.
</p>
-<p>This manual is for version 3.8 of GNU Grep.
+<p>This manual is for version 3.10 of GNU Grep.
</p>
-<p>This manual is for <code>grep</code>, a pattern matching engine.
+<p>This manual is for <code class="command">grep</code>, a pattern matching
engine.
</p>
-<p>Copyright © 1999–2002, 2005, 2008–2022 Free Software
Foundation,
+<p>Copyright © 1999–2002, 2005, 2008–2023 Free Software
Foundation,
Inc.
</p>
-<blockquote>
+<blockquote class="quotation">
<p>Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
@@ -89,17 +87,17 @@
-<div class="Contents_element" id="SEC_Contents">
+<div class="element-contents" id="SEC_Contents">
<h2 class="contents-heading">Table of Contents</h2>
<div class="contents">
-<ul class="no-bullet">
+<ul class="toc-numbered-mark">
<li><a id="toc-Introduction-1" href="#Introduction">1 Introduction</a></li>
- <li><a id="toc-Invoking-grep" href="#Invoking">2 Invoking
<code>grep</code></a>
- <ul class="no-bullet">
+ <li><a id="toc-Invoking-grep" href="#Invoking">2 Invoking <code
class="command">grep</code></a>
+ <ul class="toc-numbered-mark">
<li><a id="toc-Command_002dline-Options-1"
href="#Command_002dline-Options">2.1 Command-line Options</a>
- <ul class="no-bullet">
+ <ul class="toc-numbered-mark">
<li><a id="toc-Generic-Program-Information-1"
href="#Generic-Program-Information">2.1.1 Generic Program Information</a></li>
<li><a id="toc-Matching-Control-1" href="#Matching-Control">2.1.2
Matching Control</a></li>
<li><a id="toc-General-Output-Control-1"
href="#General-Output-Control">2.1.3 General Output Control</a></li>
@@ -110,10 +108,10 @@
</ul></li>
<li><a id="toc-Environment-Variables-1" href="#Environment-Variables">2.2
Environment Variables</a></li>
<li><a id="toc-Exit-Status-1" href="#Exit-Status">2.3 Exit Status</a></li>
- <li><a id="toc-grep-Programs-1" href="#grep-Programs">2.4
<code>grep</code> Programs</a></li>
+ <li><a id="toc-grep-Programs-1" href="#grep-Programs">2.4 <code
class="command">grep</code> Programs</a></li>
</ul></li>
<li><a id="toc-Regular-Expressions-1" href="#Regular-Expressions">3 Regular
Expressions</a>
- <ul class="no-bullet">
+ <ul class="toc-numbered-mark">
<li><a id="toc-Fundamental-Structure-1" href="#Fundamental-Structure">3.1
Fundamental Structure</a></li>
<li><a id="toc-Character-Classes-and-Bracket-Expressions-1"
href="#Character-Classes-and-Bracket-Expressions">3.2 Character Classes and
Bracket Expressions</a></li>
<li><a id="toc-Special-Backslash-Expressions-1"
href="#Special-Backslash-Expressions">3.3 Special Backslash Expressions</a></li>
@@ -127,11 +125,11 @@
<li><a id="toc-Usage-1" href="#Usage">4 Usage</a></li>
<li><a id="toc-Performance-1" href="#Performance">5 Performance</a></li>
<li><a id="toc-Reporting-bugs" href="#Reporting-Bugs">6 Reporting bugs</a>
- <ul class="no-bullet">
+ <ul class="toc-numbered-mark">
<li><a id="toc-Known-Bugs-1" href="#Known-Bugs">6.1 Known Bugs</a></li>
</ul></li>
<li><a id="toc-Copying-1" href="#Copying">7 Copying</a>
- <ul class="no-bullet">
+ <ul class="toc-numbered-mark">
<li><a id="toc-GNU-Free-Documentation-License-1"
href="#GNU-Free-Documentation-License">7.1 GNU Free Documentation
License</a></li>
</ul></li>
<li><a id="toc-Index-1" href="#Index" rel="index">Index</a></li>
@@ -139,68 +137,68 @@
</div>
</div>
<hr>
-<div class="chapter" id="Introduction">
-<div class="header">
+<div class="chapter-level-extent" id="Introduction">
+<div class="nav-panel">
<p>
-Next: <a href="#Invoking" accesskey="n" rel="next">Invoking
<code>grep</code></a>, Previous: <a href="#Top" accesskey="p"
rel="prev">grep</a>, Up: <a href="#Top" accesskey="u" rel="up">grep</a>
[<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
+Next: <a href="#Invoking" accesskey="n" rel="next">Invoking <code
class="command">grep</code></a>, Previous: <a href="#Top" accesskey="p"
rel="prev">grep</a>, Up: <a href="#Top" accesskey="u" rel="up">grep</a>
[<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Introduction-1"></span><h2 class="chapter">1 Introduction</h2>
+<h2 class="chapter" id="Introduction-1"><span>1 Introduction<a
class="copiable-link" href="#Introduction-1"> ¶</a></span></h2>
-<span id="index-searching-for-patterns"></span>
+<a class="index-entry-id" id="index-searching-for-patterns"></a>
-<p>Given one or more patterns, <code>grep</code> searches input files
+<p>Given one or more patterns, <code class="command">grep</code> searches
input files
for matches to the patterns.
When it finds a match in a line,
it copies the line to standard output (by default),
or produces whatever other sort of output you have requested with options.
</p>
-<p>Though <code>grep</code> expects to do the matching on text,
+<p>Though <code class="command">grep</code> expects to do the matching on text,
it has no limits on input line length other than available memory,
and it can match arbitrary characters within a line.
If the final byte of an input file is not a newline,
-<code>grep</code> silently supplies one.
+<code class="command">grep</code> silently supplies one.
Since newline is also a separator for the list of patterns,
there is no way to match newline characters in a text.
</p>
<hr>
</div>
-<div class="chapter" id="Invoking">
-<div class="header">
+<div class="chapter-level-extent" id="Invoking">
+<div class="nav-panel">
<p>
Next: <a href="#Regular-Expressions" accesskey="n" rel="next">Regular
Expressions</a>, Previous: <a href="#Introduction" accesskey="p"
rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">grep</a>
[<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Invoking-grep"></span><h2 class="chapter">2 Invoking
<code>grep</code></h2>
+<h2 class="chapter" id="Invoking-grep"><span>2 Invoking <code
class="command">grep</code><a class="copiable-link" href="#Invoking-grep">
¶</a></span></h2>
-<p>The general synopsis of the <code>grep</code> command line is
+<p>The general synopsis of the <code class="command">grep</code> command line
is
</p>
<div class="example">
-<pre class="example">grep [<var>option</var>...] [<var>patterns</var>]
[<var>file</var>...]
+<pre class="example-preformatted">grep [<var class="var">option</var>...]
[<var class="var">patterns</var>] [<var class="var">file</var>...]
</pre></div>
-<p>There can be zero or more <var>option</var> arguments, and zero or more
-<var>file</var> arguments. The <var>patterns</var> argument contains one or
+<p>There can be zero or more <var class="var">option</var> arguments, and zero
or more
+<var class="var">file</var> arguments. The <var class="var">patterns</var>
argument contains one or
more patterns separated by newlines, and is omitted when patterns are
-given via the ‘<samp>-e <var>patterns</var></samp>’ or
‘<samp>-f <var>file</var></samp>’
-options. Typically <var>patterns</var> should be quoted when
-<code>grep</code> is used in a shell command.
+given via the ‘<samp class="samp">-e <var
class="var">patterns</var></samp>’ or ‘<samp
class="samp">-f <var class="var">file</var></samp>’
+options. Typically <var class="var">patterns</var> should be quoted when
+<code class="command">grep</code> is used in a shell command.
</p>
-<ul class="section-toc">
+<ul class="mini-toc">
<li><a href="#Command_002dline-Options" accesskey="1">Command-line
Options</a></li>
<li><a href="#Environment-Variables" accesskey="2">Environment
Variables</a></li>
<li><a href="#Exit-Status" accesskey="3">Exit Status</a></li>
-<li><a href="#grep-Programs" accesskey="4"><code>grep</code> Programs</a></li>
+<li><a href="#grep-Programs" accesskey="4"><code class="command">grep</code>
Programs</a></li>
</ul>
<hr>
-<div class="section" id="Command_002dline-Options">
-<div class="header">
+<div class="section-level-extent" id="Command_002dline-Options">
+<div class="nav-panel">
<p>
-Next: <a href="#Environment-Variables" accesskey="n" rel="next">Environment
Variables</a>, Up: <a href="#Invoking" accesskey="u" rel="up">Invoking
<code>grep</code></a> [<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
+Next: <a href="#Environment-Variables" accesskey="n" rel="next">Environment
Variables</a>, Up: <a href="#Invoking" accesskey="u" rel="up">Invoking <code
class="command">grep</code></a> [<a href="#SEC_Contents" title="Table of
contents" rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Command_002dline-Options-1"></span><h3 class="section">2.1
Command-line Options</h3>
+<h3 class="section" id="Command_002dline-Options-1"><span>2.1 Command-line
Options<a class="copiable-link" href="#Command_002dline-Options-1">
¶</a></span></h3>
-<p><code>grep</code> comes with a rich set of options:
+<p><code class="command">grep</code> comes with a rich set of options:
some from POSIX and some being GNU extensions.
Long option names are always a GNU extension,
even for options that are from POSIX specifications.
@@ -213,10 +211,10 @@
</p>
<p>Several additional options control
-which variant of the <code>grep</code> matching engine is used.
-See <a href="#grep-Programs"><code>grep</code> Programs</a>.
+which variant of the <code class="command">grep</code> matching engine is used.
+See <a class="xref" href="#grep-Programs"><code class="command">grep</code>
Programs</a>.
</p>
-<ul class="section-toc">
+<ul class="mini-toc">
<li><a href="#Generic-Program-Information" accesskey="1">Generic Program
Information</a></li>
<li><a href="#Matching-Control" accesskey="2">Matching Control</a></li>
<li><a href="#General-Output-Control" accesskey="3">General Output
Control</a></li>
@@ -226,25 +224,27 @@
<li><a href="#Other-Options" accesskey="7">Other Options</a></li>
</ul>
<hr>
-<div class="subsection" id="Generic-Program-Information">
-<div class="header">
+<div class="subsection-level-extent" id="Generic-Program-Information">
+<div class="nav-panel">
<p>
Next: <a href="#Matching-Control" accesskey="n" rel="next">Matching
Control</a>, Up: <a href="#Command_002dline-Options" accesskey="u"
rel="up">Command-line Options</a> [<a href="#SEC_Contents" title="Table
of contents" rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Generic-Program-Information-1"></span><h4 class="subsection">2.1.1
Generic Program Information</h4>
+<h4 class="subsection" id="Generic-Program-Information-1"><span>2.1.1 Generic
Program Information<a class="copiable-link"
href="#Generic-Program-Information-1"> ¶</a></span></h4>
-<dl compact="compact">
-<dt id='index-_002d_002dhelp'><span><samp>--help</samp><a
href='#index-_002d_002dhelp' class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-usage-summary_002c-printing"></span>
+<dl class="table">
+<dt><samp class="option">--help</samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dhelp"></a>
+<a class="index-entry-id" id="index-usage-summary_002c-printing"></a>
<p>Print a usage message briefly summarizing the command-line options
and the bug-reporting address, then exit.
</p>
</dd>
-<dt id='index-_002dV'><span><samp>-V</samp><a href='#index-_002dV'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--version</samp></span></dt>
-<dd><span id="index-_002d_002dversion"></span>
-<span id="index-version_002c-printing"></span>
-<p>Print the version number of <code>grep</code> to the standard output stream.
+<dt><samp class="option">-V</samp></dt>
+<dt><samp class="option">--version</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dV"></a>
+<a class="index-entry-id" id="index-_002d_002dversion"></a>
+<a class="index-entry-id" id="index-version_002c-printing"></a>
+<p>Print the version number of <code class="command">grep</code> to the
standard output stream.
This version number should be included in all bug reports.
</p>
</dd>
@@ -252,44 +252,47 @@
<hr>
</div>
-<div class="subsection" id="Matching-Control">
-<div class="header">
+<div class="subsection-level-extent" id="Matching-Control">
+<div class="nav-panel">
<p>
Next: <a href="#General-Output-Control" accesskey="n" rel="next">General
Output Control</a>, Previous: <a href="#Generic-Program-Information"
accesskey="p" rel="prev">Generic Program Information</a>, Up: <a
href="#Command_002dline-Options" accesskey="u" rel="up">Command-line
Options</a> [<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Matching-Control-1"></span><h4 class="subsection">2.1.2 Matching
Control</h4>
+<h4 class="subsection" id="Matching-Control-1"><span>2.1.2 Matching Control<a
class="copiable-link" href="#Matching-Control-1"> ¶</a></span></h4>
-<dl compact="compact">
-<dt id='index-_002de'><span><samp>-e <var>patterns</var></samp><a
href='#index-_002de' class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--regexp=<var>patterns</var></samp></span></dt>
-<dd><span id="index-_002d_002dregexp_003dpatterns"></span>
-<span id="index-patterns-option"></span>
-<p>Use <var>patterns</var> as one or more patterns; newlines within
-<var>patterns</var> separate each pattern from the next.
+<dl class="table">
+<dt><samp class="option">-e <var class="var">patterns</var></samp></dt>
+<dt><samp class="option">--regexp=<var class="var">patterns</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002de"></a>
+<a class="index-entry-id" id="index-_002d_002dregexp_003dpatterns"></a>
+<a class="index-entry-id" id="index-patterns-option"></a>
+<p>Use <var class="var">patterns</var> as one or more patterns; newlines within
+<var class="var">patterns</var> separate each pattern from the next.
If this option is used multiple times or is combined with the
-<samp>-f</samp> (<samp>--file</samp>) option, search for all patterns given.
-Typically <var>patterns</var> should be quoted when <code>grep</code> is used
+<samp class="option">-f</samp> (<samp class="option">--file</samp>) option,
search for all patterns given.
+Typically <var class="var">patterns</var> should be quoted when <code
class="command">grep</code> is used
in a shell command.
-(<samp>-e</samp> is specified by POSIX.)
+(<samp class="option">-e</samp> is specified by POSIX.)
</p>
</dd>
-<dt id='index-_002df'><span><samp>-f <var>file</var></samp><a
href='#index-_002df' class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--file=<var>file</var></samp></span></dt>
-<dd><span id="index-_002d_002dfile"></span>
-<span id="index-patterns-from-file"></span>
-<p>Obtain patterns from <var>file</var>, one per line.
+<dt><samp class="option">-f <var class="var">file</var></samp></dt>
+<dt><samp class="option">--file=<var class="var">file</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002df"></a>
+<a class="index-entry-id" id="index-_002d_002dfile"></a>
+<a class="index-entry-id" id="index-patterns-from-file"></a>
+<p>Obtain patterns from <var class="var">file</var>, one per line.
If this option is used multiple times or is combined with the
-<samp>-e</samp> (<samp>--regexp</samp>) option, search for all patterns given.
+<samp class="option">-e</samp> (<samp class="option">--regexp</samp>) option,
search for all patterns given.
The empty file contains zero patterns, and therefore matches nothing.
-(<samp>-f</samp> is specified by POSIX.)
+(<samp class="option">-f</samp> is specified by POSIX.)
</p>
</dd>
-<dt id='index-_002di'><span><samp>-i</samp><a href='#index-_002di'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>-y</samp></span></dt>
-<dt><span><samp>--ignore-case</samp></span></dt>
-<dd><span id="index-_002dy"></span>
-<span id="index-_002d_002dignore_002dcase"></span>
-<span id="index-case-insensitive-search"></span>
+<dt><samp class="option">-i</samp></dt>
+<dt><samp class="option">-y</samp></dt>
+<dt><samp class="option">--ignore-case</samp></dt>
+<dd><a class="index-entry-id" id="index-_002di"></a>
+<a class="index-entry-id" id="index-_002dy"></a>
+<a class="index-entry-id" id="index-_002d_002dignore_002dcase"></a>
+<a class="index-entry-id" id="index-case-insensitive-search"></a>
<p>Ignore case distinctions in patterns and input data,
so that characters that differ only in case
match each other. Although this is straightforward when letters
@@ -301,33 +304,38 @@
it yields “S”. Another example: the lowercase German letter
“Ô
(U+00DF, LATIN SMALL LETTER SHARP S) is normally capitalized as the
two-character string “SS” but it does not match “SS”,
and it might
-not match the uppercase letter “Ẕ (U+1E9E, LATIN CAPITAL LETTER
+not match the uppercase letter
+“Ẕ
+(U+1E9E, LATIN CAPITAL LETTER
SHARP S) even though lowercasing the latter yields the former.
</p>
-<p><samp>-y</samp> is an obsolete synonym that is provided for compatibility.
-(<samp>-i</samp> is specified by POSIX.)
+<p><samp class="option">-y</samp> is an obsolete synonym that is provided for
compatibility.
+(<samp class="option">-i</samp> is specified by POSIX.)
</p>
</dd>
-<dt
id='index-_002d_002dno_002dignore_002dcase'><span><samp>--no-ignore-case</samp><a
href='#index-_002d_002dno_002dignore_002dcase' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>Do not ignore case distinctions in patterns and input data. This is
+<dt><samp class="option">--no-ignore-case</samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dno_002dignore_002dcase"></a>
+<p>Do not ignore case distinctions in patterns and input data. This is
the default. This option is useful for passing to shell scripts that
-already use <samp>-i</samp>, in order to cancel its effects because the
+already use <samp class="option">-i</samp>, in order to cancel its effects
because the
two options override each other.
</p>
</dd>
-<dt id='index-_002dv'><span><samp>-v</samp><a href='#index-_002dv'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--invert-match</samp></span></dt>
-<dd><span id="index-_002d_002dinvert_002dmatch"></span>
-<span id="index-invert-matching"></span>
-<span id="index-print-non_002dmatching-lines"></span>
+<dt><samp class="option">-v</samp></dt>
+<dt><samp class="option">--invert-match</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dv"></a>
+<a class="index-entry-id" id="index-_002d_002dinvert_002dmatch"></a>
+<a class="index-entry-id" id="index-invert-matching"></a>
+<a class="index-entry-id" id="index-print-non_002dmatching-lines"></a>
<p>Invert the sense of matching, to select non-matching lines.
-(<samp>-v</samp> is specified by POSIX.)
+(<samp class="option">-v</samp> is specified by POSIX.)
</p>
</dd>
-<dt id='index-_002dw'><span><samp>-w</samp><a href='#index-_002dw'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--word-regexp</samp></span></dt>
-<dd><span id="index-_002d_002dword_002dregexp"></span>
-<span id="index-matching-whole-words"></span>
+<dt><samp class="option">-w</samp></dt>
+<dt><samp class="option">--word-regexp</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dw"></a>
+<a class="index-entry-id" id="index-_002d_002dword_002dregexp"></a>
+<a class="index-entry-id" id="index-matching-whole-words"></a>
<p>Select only those lines containing matches that form whole words.
The test is that the matching substring must either
be at the beginning of the line,
@@ -336,110 +344,116 @@
it must be either at the end of the line
or followed by a non-word constituent character.
Word constituent characters are letters, digits, and the underscore.
-This option has no effect if <samp>-x</samp> is also specified.
+This option has no effect if <samp class="option">-x</samp> is also specified.
</p>
-<p>Because the <samp>-w</samp> option can match a substring that does not
+<p>Because the <samp class="option">-w</samp> option can match a substring
that does not
begin and end with word constituents, it differs from surrounding a
-regular expression with ‘<samp>\<</samp>’ and
‘<samp>\></samp>’. For example, although
-‘<samp>grep -w @</samp>’ matches a line containing only
‘<samp>@</samp>’, ‘<samp>grep
-'\<@\>'</samp>’ cannot match any line because
‘<samp>@</samp>’ is not a
-word constituent. See <a href="#Special-Backslash-Expressions">Special
Backslash Expressions</a>.
+regular expression with ‘<samp class="samp">\<</samp>’ and
‘<samp class="samp">\></samp>’. For example, although
+‘<samp class="samp">grep -w @</samp>’ matches a line containing
only ‘<samp class="samp">@</samp>’, ‘<samp class="samp">grep
+'\<@\>'</samp>’ cannot match any line because ‘<samp
class="samp">@</samp>’ is not a
+word constituent. See <a class="xref"
href="#Special-Backslash-Expressions">Special Backslash Expressions</a>.
</p>
</dd>
-<dt id='index-_002dx'><span><samp>-x</samp><a href='#index-_002dx'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--line-regexp</samp></span></dt>
-<dd><span id="index-_002d_002dline_002dregexp"></span>
-<span id="index-match-the-whole-line"></span>
+<dt><samp class="option">-x</samp></dt>
+<dt><samp class="option">--line-regexp</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dx"></a>
+<a class="index-entry-id" id="index-_002d_002dline_002dregexp"></a>
+<a class="index-entry-id" id="index-match-the-whole-line"></a>
<p>Select only those matches that exactly match the whole line.
For regular expression patterns, this is like parenthesizing each
-pattern and then surrounding it with ‘<samp>^</samp>’ and
‘<samp>$</samp>’.
-(<samp>-x</samp> is specified by POSIX.)
+pattern and then surrounding it with ‘<samp class="samp">^</samp>’
and ‘<samp class="samp">$</samp>’.
+(<samp class="option">-x</samp> is specified by POSIX.)
</p>
</dd>
</dl>
<hr>
</div>
-<div class="subsection" id="General-Output-Control">
-<div class="header">
+<div class="subsection-level-extent" id="General-Output-Control">
+<div class="nav-panel">
<p>
Next: <a href="#Output-Line-Prefix-Control" accesskey="n" rel="next">Output
Line Prefix Control</a>, Previous: <a href="#Matching-Control" accesskey="p"
rel="prev">Matching Control</a>, Up: <a href="#Command_002dline-Options"
accesskey="u" rel="up">Command-line Options</a> [<a href="#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a href="#Index"
title="Index" rel="index">Index</a>]</p>
</div>
-<span id="General-Output-Control-1"></span><h4 class="subsection">2.1.3
General Output Control</h4>
+<h4 class="subsection" id="General-Output-Control-1"><span>2.1.3 General
Output Control<a class="copiable-link" href="#General-Output-Control-1">
¶</a></span></h4>
-<dl compact="compact">
-<dt id='index-_002dc'><span><samp>-c</samp><a href='#index-_002dc'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--count</samp></span></dt>
-<dd><span id="index-_002d_002dcount"></span>
-<span id="index-counting-lines"></span>
+<dl class="table">
+<dt><samp class="option">-c</samp></dt>
+<dt><samp class="option">--count</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dc"></a>
+<a class="index-entry-id" id="index-_002d_002dcount"></a>
+<a class="index-entry-id" id="index-counting-lines"></a>
<p>Suppress normal output;
instead print a count of matching lines for each input file.
-With the <samp>-v</samp> (<samp>--invert-match</samp>) option,
+With the <samp class="option">-v</samp> (<samp
class="option">--invert-match</samp>) option,
count non-matching lines.
-(<samp>-c</samp> is specified by POSIX.)
+(<samp class="option">-c</samp> is specified by POSIX.)
</p>
</dd>
-<dt id='index-_002d_002dcolor'><span><samp>--color[=<var>WHEN</var>]</samp><a
href='#index-_002d_002dcolor' class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--colour[=<var>WHEN</var>]</samp></span></dt>
-<dd><span id="index-_002d_002dcolour"></span>
-<span id="index-highlight_002c-color_002c-colour"></span>
+<dt><samp class="option">--color[=<var class="var">WHEN</var>]</samp></dt>
+<dt><samp class="option">--colour[=<var class="var">WHEN</var>]</samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dcolor"></a>
+<a class="index-entry-id" id="index-_002d_002dcolour"></a>
+<a class="index-entry-id" id="index-highlight_002c-color_002c-colour"></a>
<p>Surround matched non-empty strings, matching lines, context lines,
file names, line numbers, byte offsets, and separators (for fields and
groups of context lines) with escape sequences to display them in color
on the terminal.
-The colors are defined by the environment variable <code>GREP_COLORS</code>
-and default to
‘<samp>ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36</samp>’
+The colors are defined by the environment variable <code
class="env">GREP_COLORS</code>
+and default to ‘<samp
class="samp">ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36</samp>’
for bold red matched text, magenta file names, green line numbers,
green byte offsets, cyan separators, and default terminal colors otherwise.
-See <a href="#Environment-Variables">Environment Variables</a>.
+See <a class="xref" href="#Environment-Variables">Environment Variables</a>.
</p>
-<p><var>WHEN</var> is ‘<samp>always</samp>’ to use colors,
‘<samp>never</samp>’ to not use
-colors, or ‘<samp>auto</samp>’ to use colors if standard output is
associated
-with a terminal device and the <code>TERM</code> environment variable’s
value
+<p><var class="var">WHEN</var> is ‘<samp
class="samp">always</samp>’ to use colors, ‘<samp
class="samp">never</samp>’ to not use
+colors, or ‘<samp class="samp">auto</samp>’ to use colors if
standard output is associated
+with a terminal device and the <code class="env">TERM</code> environment
variable’s value
suggests that the terminal supports colors.
-Plain <samp>--color</samp> is treated like <samp>--color=auto</samp>;
-if no <samp>--color</samp> option is given, the default is
<samp>--color=never</samp>.
+Plain <samp class="option">--color</samp> is treated like <samp
class="option">--color=auto</samp>;
+if no <samp class="option">--color</samp> option is given, the default is
<samp class="option">--color=never</samp>.
</p>
</dd>
-<dt id='index-_002dL'><span><samp>-L</samp><a href='#index-_002dL'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--files-without-match</samp></span></dt>
-<dd><span id="index-_002d_002dfiles_002dwithout_002dmatch"></span>
-<span id="index-files-which-don_0027t-match"></span>
+<dt><samp class="option">-L</samp></dt>
+<dt><samp class="option">--files-without-match</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dL"></a>
+<a class="index-entry-id" id="index-_002d_002dfiles_002dwithout_002dmatch"></a>
+<a class="index-entry-id" id="index-files-which-don_0027t-match"></a>
<p>Suppress normal output;
instead print the name of each input file from which
no output would normally have been printed.
</p>
</dd>
-<dt id='index-_002dl'><span><samp>-l</samp><a href='#index-_002dl'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--files-with-matches</samp></span></dt>
-<dd><span id="index-_002d_002dfiles_002dwith_002dmatches"></span>
-<span id="index-names-of-matching-files"></span>
+<dt><samp class="option">-l</samp></dt>
+<dt><samp class="option">--files-with-matches</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dl"></a>
+<a class="index-entry-id" id="index-_002d_002dfiles_002dwith_002dmatches"></a>
+<a class="index-entry-id" id="index-names-of-matching-files"></a>
<p>Suppress normal output;
instead print the name of each input file from which
output would normally have been printed.
Scanning each input file stops upon first match.
-(<samp>-l</samp> is specified by POSIX.)
+(<samp class="option">-l</samp> is specified by POSIX.)
</p>
</dd>
-<dt id='index-_002dm'><span><samp>-m <var>num</var></samp><a
href='#index-_002dm' class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--max-count=<var>num</var></samp></span></dt>
-<dd><span id="index-_002d_002dmax_002dcount"></span>
-<span id="index-max_002dcount"></span>
-<p>Stop after the first <var>num</var> selected lines.
-If <var>num</var> is zero, <code>grep</code> stops right away without reading
input.
-A <var>num</var> of -1 is treated as infinity and <code>grep</code>
+<dt><samp class="option">-m <var class="var">num</var></samp></dt>
+<dt><samp class="option">--max-count=<var class="var">num</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002dm"></a>
+<a class="index-entry-id" id="index-_002d_002dmax_002dcount"></a>
+<a class="index-entry-id" id="index-max_002dcount"></a>
+<p>Stop after the first <var class="var">num</var> selected lines.
+If <var class="var">num</var> is zero, <code class="command">grep</code> stops
right away without reading input.
+A <var class="var">num</var> of −1 is treated as infinity and <code
class="command">grep</code>
does not stop; this is the default.
</p>
<p>If the input is standard input from a regular file,
-and <var>num</var> selected lines are output,
-<code>grep</code> ensures that the standard input is positioned
+and <var class="var">num</var> selected lines are output,
+<code class="command">grep</code> ensures that the standard input is positioned
just after the last selected line before exiting,
regardless of the presence of trailing context lines.
This enables a calling process to resume a search.
For example, the following shell script makes use of it:
</p>
<div class="example">
-<pre class="example">while grep -m 1 'PATTERN'
+<pre class="example-preformatted">while grep -m 1 'PATTERN'
do
echo xxxx
done < FILE
@@ -449,7 +463,7 @@
file:
</p>
<div class="example">
-<pre class="example"># This probably will not work.
+<pre class="example-preformatted"># This probably will not work.
cat FILE |
while grep -m 1 'PATTERN'
do
@@ -457,137 +471,147 @@
done
</pre></div>
-<span id="index-context-lines"></span>
-<p>When <code>grep</code> stops after <var>num</var> selected lines,
+<a class="index-entry-id" id="index-context-lines"></a>
+<p>When <code class="command">grep</code> stops after <var
class="var">num</var> selected lines,
it outputs any trailing context lines.
-When the <samp>-c</samp> or <samp>--count</samp> option is also used,
-<code>grep</code> does not output a count greater than <var>num</var>.
-When the <samp>-v</samp> or <samp>--invert-match</samp> option is also used,
-<code>grep</code> stops after outputting <var>num</var> non-matching lines.
+When the <samp class="option">-c</samp> or <samp class="option">--count</samp>
option is also used,
+<code class="command">grep</code> does not output a count greater than <var
class="var">num</var>.
+When the <samp class="option">-v</samp> or <samp
class="option">--invert-match</samp> option is also used,
+<code class="command">grep</code> stops after outputting <var
class="var">num</var> non-matching lines.
</p>
</dd>
-<dt id='index-_002do'><span><samp>-o</samp><a href='#index-_002do'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--only-matching</samp></span></dt>
-<dd><span id="index-_002d_002donly_002dmatching"></span>
-<span id="index-only-matching"></span>
+<dt><samp class="option">-o</samp></dt>
+<dt><samp class="option">--only-matching</samp></dt>
+<dd><a class="index-entry-id" id="index-_002do"></a>
+<a class="index-entry-id" id="index-_002d_002donly_002dmatching"></a>
+<a class="index-entry-id" id="index-only-matching"></a>
<p>Print only the matched non-empty parts of matching lines,
with each such part on a separate output line.
Output lines use the same delimiters as input, and delimiters are null
-bytes if <samp>-z</samp> (<samp>--null-data</samp>) is also used (see <a
href="#Other-Options">Other Options</a>).
+bytes if <samp class="option">-z</samp> (<samp
class="option">--null-data</samp>) is also used (see <a class="pxref"
href="#Other-Options">Other Options</a>).
</p>
</dd>
-<dt id='index-_002dq'><span><samp>-q</samp><a href='#index-_002dq'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--quiet</samp></span></dt>
-<dt><span><samp>--silent</samp></span></dt>
-<dd><span id="index-_002d_002dquiet"></span>
-<span id="index-_002d_002dsilent"></span>
-<span id="index-quiet_002c-silent"></span>
+<dt><samp class="option">-q</samp></dt>
+<dt><samp class="option">--quiet</samp></dt>
+<dt><samp class="option">--silent</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dq"></a>
+<a class="index-entry-id" id="index-_002d_002dquiet"></a>
+<a class="index-entry-id" id="index-_002d_002dsilent"></a>
+<a class="index-entry-id" id="index-quiet_002c-silent"></a>
<p>Quiet; do not write anything to standard output.
Exit immediately with zero status if any match is found,
even if an error was detected.
-Also see the <samp>-s</samp> or <samp>--no-messages</samp> option.
-Portability note: Solaris 10 <code>grep</code> lacks <samp>-q</samp>;
+Also see the <samp class="option">-s</samp> or <samp
class="option">--no-messages</samp> option.
+Portability note: Solaris 10 <code class="command">grep</code> lacks <samp
class="option">-q</samp>;
portable shell scripts typically can redirect standard output to
-<samp>/dev/null</samp> instead of using <samp>-q</samp>.
-(<samp>-q</samp> is specified by POSIX.)
+<samp class="file">/dev/null</samp> instead of using <samp
class="option">-q</samp>.
+(<samp class="option">-q</samp> is specified by POSIX.)
</p>
</dd>
-<dt id='index-_002ds'><span><samp>-s</samp><a href='#index-_002ds'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--no-messages</samp></span></dt>
-<dd><span id="index-_002d_002dno_002dmessages"></span>
-<span id="index-suppress-error-messages"></span>
+<dt><samp class="option">-s</samp></dt>
+<dt><samp class="option">--no-messages</samp></dt>
+<dd><a class="index-entry-id" id="index-_002ds"></a>
+<a class="index-entry-id" id="index-_002d_002dno_002dmessages"></a>
+<a class="index-entry-id" id="index-suppress-error-messages"></a>
<p>Suppress error messages about nonexistent or unreadable files.
-(<samp>-s</samp> is specified by POSIX.)
+(<samp class="option">-s</samp> is specified by POSIX.)
</p>
</dd>
</dl>
<hr>
</div>
-<div class="subsection" id="Output-Line-Prefix-Control">
-<div class="header">
+<div class="subsection-level-extent" id="Output-Line-Prefix-Control">
+<div class="nav-panel">
<p>
Next: <a href="#Context-Line-Control" accesskey="n" rel="next">Context Line
Control</a>, Previous: <a href="#General-Output-Control" accesskey="p"
rel="prev">General Output Control</a>, Up: <a href="#Command_002dline-Options"
accesskey="u" rel="up">Command-line Options</a> [<a href="#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a href="#Index"
title="Index" rel="index">Index</a>]</p>
</div>
-<span id="Output-Line-Prefix-Control-1"></span><h4 class="subsection">2.1.4
Output Line Prefix Control</h4>
+<h4 class="subsection" id="Output-Line-Prefix-Control-1"><span>2.1.4 Output
Line Prefix Control<a class="copiable-link"
href="#Output-Line-Prefix-Control-1"> ¶</a></span></h4>
<p>When several prefix fields are to be output,
the order is always file name, line number, and byte offset,
regardless of the order in which these options were specified.
</p>
-<dl compact="compact">
-<dt id='index-_002db'><span><samp>-b</samp><a href='#index-_002db'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--byte-offset</samp></span></dt>
-<dd><span id="index-_002d_002dbyte_002doffset"></span>
-<span id="index-byte-offset"></span>
+<dl class="table">
+<dt><samp class="option">-b</samp></dt>
+<dt><samp class="option">--byte-offset</samp></dt>
+<dd><a class="index-entry-id" id="index-_002db"></a>
+<a class="index-entry-id" id="index-_002d_002dbyte_002doffset"></a>
+<a class="index-entry-id" id="index-byte-offset"></a>
<p>Print the 0-based byte offset within the input file
before each line of output.
-If <samp>-o</samp> (<samp>--only-matching</samp>) is specified,
+If <samp class="option">-o</samp> (<samp
class="option">--only-matching</samp>) is specified,
print the offset of the matching part itself.
</p>
</dd>
-<dt id='index-_002dH'><span><samp>-H</samp><a href='#index-_002dH'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--with-filename</samp></span></dt>
-<dd><span id="index-_002d_002dwith_002dfilename"></span>
-<span id="index-with-filename-prefix"></span>
+<dt><samp class="option">-H</samp></dt>
+<dt><samp class="option">--with-filename</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dH"></a>
+<a class="index-entry-id" id="index-_002d_002dwith_002dfilename"></a>
+<a class="index-entry-id" id="index-with-filename-prefix"></a>
<p>Print the file name for each match.
This is the default when there is more than one file to search.
</p>
</dd>
-<dt id='index-_002dh'><span><samp>-h</samp><a href='#index-_002dh'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--no-filename</samp></span></dt>
-<dd><span id="index-_002d_002dno_002dfilename"></span>
-<span id="index-no-filename-prefix"></span>
+<dt><samp class="option">-h</samp></dt>
+<dt><samp class="option">--no-filename</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dh"></a>
+<a class="index-entry-id" id="index-_002d_002dno_002dfilename"></a>
+<a class="index-entry-id" id="index-no-filename-prefix"></a>
<p>Suppress the prefixing of file names on output.
This is the default when there is only one file
(or only standard input) to search.
</p>
</dd>
-<dt id='index-_002d_002dlabel'><span><samp>--label=<var>LABEL</var></samp><a
href='#index-_002d_002dlabel' class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-changing-name-of-standard-input"></span>
+<dt><samp class="option">--label=<var class="var">LABEL</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dlabel"></a>
+<a class="index-entry-id" id="index-changing-name-of-standard-input"></a>
<p>Display input actually coming from standard input
-as input coming from file <var>LABEL</var>.
+as input coming from file <var class="var">LABEL</var>.
This can be useful for commands that transform a file’s contents
before searching; e.g.:
</p>
<div class="example">
-<pre class="example">gzip -cd foo.gz | grep --label=foo -H 'some pattern'
+<pre class="example-preformatted">gzip -cd foo.gz | grep --label=foo -H 'some
pattern'
</pre></div>
</dd>
-<dt id='index-_002dn'><span><samp>-n</samp><a href='#index-_002dn'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--line-number</samp></span></dt>
-<dd><span id="index-_002d_002dline_002dnumber"></span>
-<span id="index-line-numbering"></span>
+<dt><samp class="option">-n</samp></dt>
+<dt><samp class="option">--line-number</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dn"></a>
+<a class="index-entry-id" id="index-_002d_002dline_002dnumber"></a>
+<a class="index-entry-id" id="index-line-numbering"></a>
<p>Prefix each line of output with the 1-based line number within its input
file.
-(<samp>-n</samp> is specified by POSIX.)
+(<samp class="option">-n</samp> is specified by POSIX.)
</p>
</dd>
-<dt id='index-_002dT'><span><samp>-T</samp><a href='#index-_002dT'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--initial-tab</samp></span></dt>
-<dd><span id="index-_002d_002dinitial_002dtab"></span>
-<span id="index-tab_002daligned-content-lines"></span>
+<dt><samp class="option">-T</samp></dt>
+<dt><samp class="option">--initial-tab</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dT"></a>
+<a class="index-entry-id" id="index-_002d_002dinitial_002dtab"></a>
+<a class="index-entry-id" id="index-tab_002daligned-content-lines"></a>
<p>Make sure that the first character of actual line content lies on a tab
stop,
so that the alignment of tabs looks normal.
This is useful with options that prefix their output to the actual content:
-<samp>-H</samp>, <samp>-n</samp>, and <samp>-b</samp>.
+<samp class="option">-H</samp>, <samp class="option">-n</samp>, and <samp
class="option">-b</samp>.
This may also prepend spaces to output line numbers and byte offsets
so that lines from a single file all start at the same column.
</p>
</dd>
-<dt id='index-_002dZ'><span><samp>-Z</samp><a href='#index-_002dZ'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--null</samp></span></dt>
-<dd><span id="index-_002d_002dnull"></span>
-<span id="index-zero_002dterminated-file-names"></span>
+<dt><samp class="option">-Z</samp></dt>
+<dt><samp class="option">--null</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dZ"></a>
+<a class="index-entry-id" id="index-_002d_002dnull"></a>
+<a class="index-entry-id" id="index-zero_002dterminated-file-names"></a>
<p>Output a zero byte (the ASCII NUL character)
instead of the character that normally follows a file name.
For example,
-‘<samp>grep -lZ</samp>’ outputs a zero byte after each file name
+‘<samp class="samp">grep -lZ</samp>’ outputs a zero byte after
each file name
instead of the usual newline.
This option makes the output unambiguous,
even in the presence of file names containing unusual characters like newlines.
This option can be used with commands like
-‘<samp>find -print0</samp>’, ‘<samp>perl -0</samp>’,
‘<samp>sort -z</samp>’, and ‘<samp>xargs -0</samp>’
+‘<samp class="samp">find -print0</samp>’, ‘<samp
class="samp">perl -0</samp>’, ‘<samp class="samp">sort
-z</samp>’, and ‘<samp class="samp">xargs -0</samp>’
to process arbitrary file names,
even those that contain newline characters.
</p>
@@ -596,83 +620,88 @@
<hr>
</div>
-<div class="subsection" id="Context-Line-Control">
-<div class="header">
+<div class="subsection-level-extent" id="Context-Line-Control">
+<div class="nav-panel">
<p>
Next: <a href="#File-and-Directory-Selection" accesskey="n" rel="next">File
and Directory Selection</a>, Previous: <a href="#Output-Line-Prefix-Control"
accesskey="p" rel="prev">Output Line Prefix Control</a>, Up: <a
href="#Command_002dline-Options" accesskey="u" rel="up">Command-line
Options</a> [<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Context-Line-Control-1"></span><h4 class="subsection">2.1.5 Context
Line Control</h4>
+<h4 class="subsection" id="Context-Line-Control-1"><span>2.1.5 Context Line
Control<a class="copiable-link" href="#Context-Line-Control-1">
¶</a></span></h4>
-<span id="index-context-lines-1"></span>
-<p><em>Context lines</em> are non-matching lines that are near a matching line.
+<a class="index-entry-id" id="index-context-lines-1"></a>
+<p><em class="dfn">Context lines</em> are non-matching lines that are near a
matching line.
They are output only if one of the following options are used.
Regardless of how these options are set,
-<code>grep</code> never outputs any given line more than once.
-If the <samp>-o</samp> (<samp>--only-matching</samp>) option is specified,
+<code class="command">grep</code> never outputs any given line more than once.
+If the <samp class="option">-o</samp> (<samp
class="option">--only-matching</samp>) option is specified,
these options have no effect and a warning is given upon their use.
</p>
-<dl compact="compact">
-<dt id='index-_002dA'><span><samp>-A <var>num</var></samp><a
href='#index-_002dA' class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--after-context=<var>num</var></samp></span></dt>
-<dd><span id="index-_002d_002dafter_002dcontext"></span>
-<span id="index-after-context"></span>
-<span id="index-context-lines_002c-after-match"></span>
-<p>Print <var>num</var> lines of trailing context after matching lines.
-</p>
-</dd>
-<dt id='index-_002dB'><span><samp>-B <var>num</var></samp><a
href='#index-_002dB' class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--before-context=<var>num</var></samp></span></dt>
-<dd><span id="index-_002d_002dbefore_002dcontext"></span>
-<span id="index-before-context"></span>
-<span id="index-context-lines_002c-before-match"></span>
-<p>Print <var>num</var> lines of leading context before matching lines.
-</p>
-</dd>
-<dt id='index-_002dC'><span><samp>-C <var>num</var></samp><a
href='#index-_002dC' class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>-<var>num</var></samp></span></dt>
-<dt><span><samp>--context=<var>num</var></samp></span></dt>
-<dd><span id="index-_002d_002dcontext"></span>
-<span id="index-_002dnum"></span>
-<span id="index-context-lines-2"></span>
-<p>Print <var>num</var> lines of leading and trailing output context.
-</p>
-</dd>
-<dt
id='index-_002d_002dgroup_002dseparator'><span><samp>--group-separator=<var>string</var></samp><a
href='#index-_002d_002dgroup_002dseparator' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-group-separator"></span>
-<p>When <samp>-A</samp>, <samp>-B</samp> or <samp>-C</samp> are in use,
-print <var>string</var> instead of <samp>--</samp> between groups of lines.
-</p>
-</dd>
-<dt
id='index-_002d_002dgroup_002dseparator-1'><span><samp>--no-group-separator</samp><a
href='#index-_002d_002dgroup_002dseparator-1' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-group-separator-1"></span>
-<p>When <samp>-A</samp>, <samp>-B</samp> or <samp>-C</samp> are in use,
+<dl class="table">
+<dt><samp class="option">-A <var class="var">num</var></samp></dt>
+<dt><samp class="option">--after-context=<var class="var">num</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002dA"></a>
+<a class="index-entry-id" id="index-_002d_002dafter_002dcontext"></a>
+<a class="index-entry-id" id="index-after-context"></a>
+<a class="index-entry-id" id="index-context-lines_002c-after-match"></a>
+<p>Print <var class="var">num</var> lines of trailing context after matching
lines.
+</p>
+</dd>
+<dt><samp class="option">-B <var class="var">num</var></samp></dt>
+<dt><samp class="option">--before-context=<var
class="var">num</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002dB"></a>
+<a class="index-entry-id" id="index-_002d_002dbefore_002dcontext"></a>
+<a class="index-entry-id" id="index-before-context"></a>
+<a class="index-entry-id" id="index-context-lines_002c-before-match"></a>
+<p>Print <var class="var">num</var> lines of leading context before matching
lines.
+</p>
+</dd>
+<dt><samp class="option">-C <var class="var">num</var></samp></dt>
+<dt><samp class="option">-<var class="var">num</var></samp></dt>
+<dt><samp class="option">--context=<var class="var">num</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002dC"></a>
+<a class="index-entry-id" id="index-_002d_002dcontext"></a>
+<a class="index-entry-id" id="index-_002dnum"></a>
+<a class="index-entry-id" id="index-context-lines-2"></a>
+<p>Print <var class="var">num</var> lines of leading and trailing output
context.
+</p>
+</dd>
+<dt><samp class="option">--group-separator=<var
class="var">string</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dgroup_002dseparator"></a>
+<a class="index-entry-id" id="index-group-separator"></a>
+<p>When <samp class="option">-A</samp>, <samp class="option">-B</samp> or
<samp class="option">-C</samp> are in use,
+print <var class="var">string</var> instead of <samp class="option">--</samp>
between groups of lines.
+</p>
+</dd>
+<dt><samp class="option">--no-group-separator</samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dgroup_002dseparator-1"></a>
+<a class="index-entry-id" id="index-group-separator-1"></a>
+<p>When <samp class="option">-A</samp>, <samp class="option">-B</samp> or
<samp class="option">-C</samp> are in use,
do not print a separator between groups of lines.
</p>
</dd>
</dl>
-<p>Here are some points about how <code>grep</code> chooses
+<p>Here are some points about how <code class="command">grep</code> chooses
the separator to print between prefix fields and line content:
</p>
-<ul>
-<li> Matching lines normally use ‘<samp>:</samp>’ as a separator
+<ul class="itemize mark-bullet">
+<li>Matching lines normally use ‘<samp class="samp">:</samp>’ as a
separator
between prefix fields and actual line content.
-</li><li> Context (i.e., non-matching) lines use ‘<samp>-</samp>’
instead.
+</li><li>Context (i.e., non-matching) lines use ‘<samp
class="samp">-</samp>’ instead.
-</li><li> When context is not specified,
+</li><li>When context is not specified,
matching lines are simply output one right after another.
-</li><li> When context is specified,
+</li><li>When context is specified,
lines that are adjacent in the input form a group
and are output one right after another, while
by default a separator appears between non-adjacent groups.
-</li><li> The default separator
-is a ‘<samp>--</samp>’ line; its presence and appearance
+</li><li>The default separator
+is a ‘<samp class="samp">--</samp>’ line; its presence and
appearance
can be changed with the options above.
-</li><li> Each group may contain
+</li><li>Each group may contain
several matching lines when they are close enough to each other
that two adjacent groups connect and can merge into a single
contiguous one.
@@ -680,166 +709,176 @@
<hr>
</div>
-<div class="subsection" id="File-and-Directory-Selection">
-<div class="header">
+<div class="subsection-level-extent" id="File-and-Directory-Selection">
+<div class="nav-panel">
<p>
Next: <a href="#Other-Options" accesskey="n" rel="next">Other Options</a>,
Previous: <a href="#Context-Line-Control" accesskey="p" rel="prev">Context Line
Control</a>, Up: <a href="#Command_002dline-Options" accesskey="u"
rel="up">Command-line Options</a> [<a href="#SEC_Contents" title="Table
of contents" rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="File-and-Directory-Selection-1"></span><h4 class="subsection">2.1.6
File and Directory Selection</h4>
+<h4 class="subsection" id="File-and-Directory-Selection-1"><span>2.1.6 File
and Directory Selection<a class="copiable-link"
href="#File-and-Directory-Selection-1"> ¶</a></span></h4>
-<dl compact="compact">
-<dt id='index-_002da'><span><samp>-a</samp><a href='#index-_002da'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--text</samp></span></dt>
-<dd><span id="index-_002d_002dtext"></span>
-<span id="index-suppress-binary-data"></span>
-<span id="index-binary-files"></span>
+<dl class="table">
+<dt><samp class="option">-a</samp></dt>
+<dt><samp class="option">--text</samp></dt>
+<dd><a class="index-entry-id" id="index-_002da"></a>
+<a class="index-entry-id" id="index-_002d_002dtext"></a>
+<a class="index-entry-id" id="index-suppress-binary-data"></a>
+<a class="index-entry-id" id="index-binary-files"></a>
<p>Process a binary file as if it were text;
-this is equivalent to the ‘<samp>--binary-files=text</samp>’
option.
+this is equivalent to the ‘<samp
class="samp">--binary-files=text</samp>’ option.
</p>
</dd>
-<dt
id='index-_002d_002dbinary_002dfiles'><span><samp>--binary-files=<var>type</var></samp><a
href='#index-_002d_002dbinary_002dfiles' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-binary-files-1"></span>
+<dt><samp class="option">--binary-files=<var class="var">type</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dbinary_002dfiles"></a>
+<a class="index-entry-id" id="index-binary-files-1"></a>
<p>If a file’s data or metadata
indicate that the file contains binary data,
-assume that the file is of type <var>type</var>.
+assume that the file is of type <var class="var">type</var>.
Non-text bytes indicate binary data; these are either output bytes that are
-improperly encoded for the current locale (see <a
href="#Environment-Variables">Environment Variables</a>), or null input bytes
when the
-<samp>-z</samp> (<samp>--null-data</samp>) option is not given (see <a
href="#Other-Options">Other Options</a>).
+improperly encoded for the current locale (see <a class="pxref"
href="#Environment-Variables">Environment Variables</a>), or null input bytes
when the
+<samp class="option">-z</samp> (<samp class="option">--null-data</samp>)
option is not given (see <a class="pxref" href="#Other-Options">Other
Options</a>).
</p>
-<p>By default, <var>type</var> is ‘<samp>binary</samp>’, and
<code>grep</code>
+<p>By default, <var class="var">type</var> is ‘<samp
class="samp">binary</samp>’, and <code class="command">grep</code>
suppresses output after null input binary data is discovered,
and suppresses output lines that contain improperly encoded data.
-When some output is suppressed, <code>grep</code> follows any output
+When some output is suppressed, <code class="command">grep</code> follows any
output
with a message to standard error saying that a binary file matches.
</p>
-<p>If <var>type</var> is ‘<samp>without-match</samp>’,
-when <code>grep</code> discovers null input binary data
+<p>If <var class="var">type</var> is ‘<samp
class="samp">without-match</samp>’,
+when <code class="command">grep</code> discovers null input binary data
it assumes that the rest of the file does not match;
-this is equivalent to the <samp>-I</samp> option.
+this is equivalent to the <samp class="option">-I</samp> option.
</p>
-<p>If <var>type</var> is ‘<samp>text</samp>’,
-<code>grep</code> processes binary data as if it were text;
-this is equivalent to the <samp>-a</samp> option.
-</p>
-<p>When <var>type</var> is ‘<samp>binary</samp>’,
<code>grep</code> may treat non-text
-bytes as line terminators even without the <samp>-z</samp>
-(<samp>--null-data</samp>) option. This means choosing
‘<samp>binary</samp>’
-versus ‘<samp>text</samp>’ can affect whether a pattern matches a
file. For
-example, when <var>type</var> is ‘<samp>binary</samp>’ the pattern
‘<samp>q$</samp>’ might
-match ‘<samp>q</samp>’ immediately followed by a null byte, even
though this
-is not matched when <var>type</var> is ‘<samp>text</samp>’.
Conversely, when
-<var>type</var> is ‘<samp>binary</samp>’ the pattern
‘<samp>.</samp>’ (period) might not
+<p>If <var class="var">type</var> is ‘<samp
class="samp">text</samp>’,
+<code class="command">grep</code> processes binary data as if it were text;
+this is equivalent to the <samp class="option">-a</samp> option.
+</p>
+<p>When <var class="var">type</var> is ‘<samp
class="samp">binary</samp>’, <code class="command">grep</code> may treat
non-text
+bytes as line terminators even without the <samp class="option">-z</samp>
+(<samp class="option">--null-data</samp>) option. This means choosing
‘<samp class="samp">binary</samp>’
+versus ‘<samp class="samp">text</samp>’ can affect whether a
pattern matches a file. For
+example, when <var class="var">type</var> is ‘<samp
class="samp">binary</samp>’ the pattern ‘<samp
class="samp">q$</samp>’ might
+match ‘<samp class="samp">q</samp>’ immediately followed by a null
byte, even though this
+is not matched when <var class="var">type</var> is ‘<samp
class="samp">text</samp>’. Conversely, when
+<var class="var">type</var> is ‘<samp class="samp">binary</samp>’
the pattern ‘<samp class="samp">.</samp>’ (period) might not
match a null byte.
</p>
-<p><em>Warning:</em> The <samp>-a</samp> (<samp>--binary-files=text</samp>)
option
+<p><em class="emph">Warning:</em> The <samp class="option">-a</samp> (<samp
class="option">--binary-files=text</samp>) option
might output binary garbage, which can have nasty side effects if the
output is a terminal and if the terminal driver interprets some of it
as commands. On the other hand, when reading files whose text
-encodings are unknown, it can be helpful to use <samp>-a</samp> or to set
-‘<samp>LC_ALL='C'</samp>’ in the environment, in order to find
more matches
+encodings are unknown, it can be helpful to use <samp class="option">-a</samp>
or to set
+‘<samp class="samp">LC_ALL='C'</samp>’ in the environment, in
order to find more matches
even if the matches are unsafe for direct display.
</p>
</dd>
-<dt id='index-_002dD'><span><samp>-D <var>action</var></samp><a
href='#index-_002dD' class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--devices=<var>action</var></samp></span></dt>
-<dd><span id="index-_002d_002ddevices"></span>
-<span id="index-device-search"></span>
-<p>If an input file is a device, FIFO, or socket, use <var>action</var> to
process it.
-If <var>action</var> is ‘<samp>read</samp>’,
+<dt><samp class="option">-D <var class="var">action</var></samp></dt>
+<dt><samp class="option">--devices=<var class="var">action</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002dD"></a>
+<a class="index-entry-id" id="index-_002d_002ddevices"></a>
+<a class="index-entry-id" id="index-device-search"></a>
+<p>If an input file is a device, FIFO, or socket, use <var
class="var">action</var> to process it.
+If <var class="var">action</var> is ‘<samp
class="samp">read</samp>’,
all devices are read just as if they were ordinary files.
-If <var>action</var> is ‘<samp>skip</samp>’,
+If <var class="var">action</var> is ‘<samp
class="samp">skip</samp>’,
devices, FIFOs, and sockets are silently skipped.
By default, devices are read if they are on the command line or if the
-<samp>-R</samp> (<samp>--dereference-recursive</samp>) option is used, and are
-skipped if they are encountered recursively and the <samp>-r</samp>
-(<samp>--recursive</samp>) option is used.
+<samp class="option">-R</samp> (<samp
class="option">--dereference-recursive</samp>) option is used, and are
+skipped if they are encountered recursively and the <samp
class="option">-r</samp>
+(<samp class="option">--recursive</samp>) option is used.
This option has no effect on a file that is read via standard input.
</p>
</dd>
-<dt id='index-_002dd'><span><samp>-d <var>action</var></samp><a
href='#index-_002dd' class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--directories=<var>action</var></samp></span></dt>
-<dd><span id="index-_002d_002ddirectories"></span>
-<span id="index-directory-search"></span>
-<span id="index-symbolic-links"></span>
-<p>If an input file is a directory, use <var>action</var> to process it.
-By default, <var>action</var> is ‘<samp>read</samp>’,
+<dt><samp class="option">-d <var class="var">action</var></samp></dt>
+<dt><samp class="option">--directories=<var
class="var">action</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002dd"></a>
+<a class="index-entry-id" id="index-_002d_002ddirectories"></a>
+<a class="index-entry-id" id="index-directory-search"></a>
+<a class="index-entry-id" id="index-symbolic-links"></a>
+<p>If an input file is a directory, use <var class="var">action</var> to
process it.
+By default, <var class="var">action</var> is ‘<samp
class="samp">read</samp>’,
which means that directories are read just as if they were ordinary files
(some operating systems and file systems disallow this,
-and will cause <code>grep</code>
+and will cause <code class="command">grep</code>
to print error messages for every directory or silently skip them).
-If <var>action</var> is ‘<samp>skip</samp>’, directories are
silently skipped.
-If <var>action</var> is ‘<samp>recurse</samp>’,
-<code>grep</code> reads all files under each directory, recursively,
+If <var class="var">action</var> is ‘<samp
class="samp">skip</samp>’, directories are silently skipped.
+If <var class="var">action</var> is ‘<samp
class="samp">recurse</samp>’,
+<code class="command">grep</code> reads all files under each directory,
recursively,
following command-line symbolic links and skipping other symlinks;
-this is equivalent to the <samp>-r</samp> option.
+this is equivalent to the <samp class="option">-r</samp> option.
</p>
</dd>
-<dt
id='index-_002d_002dexclude'><span><samp>--exclude=<var>glob</var></samp><a
href='#index-_002d_002dexclude' class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-exclude-files"></span>
-<span id="index-searching-directory-trees"></span>
+<dt><samp class="option">--exclude=<var class="var">glob</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dexclude"></a>
+<a class="index-entry-id" id="index-exclude-files"></a>
+<a class="index-entry-id" id="index-searching-directory-trees"></a>
<p>Skip any command-line file with a name suffix that matches the pattern
-<var>glob</var>, using wildcard matching; a name suffix is either the whole
+<var class="var">glob</var>, using wildcard matching; a name suffix is either
the whole
name, or a trailing part that starts with a non-slash character
-immediately after a slash (‘<samp>/</samp>’) in the name.
+immediately after a slash (‘<samp class="samp">/</samp>’) in the
name.
When searching recursively, skip any subfile whose base
-name matches <var>glob</var>; the base name is the part after the last
+name matches <var class="var">glob</var>; the base name is the part after the
last
slash. A pattern can use
-‘<samp>*</samp>’, ‘<samp>?</samp>’, and
‘<samp>[</samp>’...‘<samp>]</samp>’ as wildcards,
-and <code>\</code> to quote a wildcard or backslash character literally.
+‘<samp class="samp">*</samp>’, ‘<samp
class="samp">?</samp>’, and ‘<samp
class="samp">[</samp>’...‘<samp class="samp">]</samp>’ as
wildcards,
+and <code class="code">\</code> to quote a wildcard or backslash character
literally.
</p>
</dd>
-<dt
id='index-_002d_002dexclude_002dfrom'><span><samp>--exclude-from=<var>file</var></samp><a
href='#index-_002d_002dexclude_002dfrom' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-exclude-files-1"></span>
-<span id="index-searching-directory-trees-1"></span>
+<dt><samp class="option">--exclude-from=<var class="var">file</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dexclude_002dfrom"></a>
+<a class="index-entry-id" id="index-exclude-files-1"></a>
+<a class="index-entry-id" id="index-searching-directory-trees-1"></a>
<p>Skip files whose name matches any of the patterns
-read from <var>file</var> (using wildcard matching as described
-under <samp>--exclude</samp>).
+read from <var class="var">file</var> (using wildcard matching as described
+under <samp class="option">--exclude</samp>).
</p>
</dd>
-<dt
id='index-_002d_002dexclude_002ddir'><span><samp>--exclude-dir=<var>glob</var></samp><a
href='#index-_002d_002dexclude_002ddir' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-exclude-directories"></span>
+<dt><samp class="option">--exclude-dir=<var class="var">glob</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dexclude_002ddir"></a>
+<a class="index-entry-id" id="index-exclude-directories"></a>
<p>Skip any command-line directory with a name suffix that matches the
-pattern <var>glob</var>. When searching recursively, skip any subdirectory
-whose base name matches <var>glob</var>. Ignore any redundant trailing
-slashes in <var>glob</var>.
+pattern <var class="var">glob</var>. When searching recursively, skip any
subdirectory
+whose base name matches <var class="var">glob</var>. Ignore any redundant
trailing
+slashes in <var class="var">glob</var>.
</p>
</dd>
-<dt><span><samp>-I</samp></span></dt>
+<dt><samp class="option">-I</samp></dt>
<dd><p>Process a binary file as if it did not contain matching data;
-this is equivalent to the
‘<samp>--binary-files=without-match</samp>’ option.
+this is equivalent to the ‘<samp
class="samp">--binary-files=without-match</samp>’ option.
</p>
</dd>
-<dt
id='index-_002d_002dinclude'><span><samp>--include=<var>glob</var></samp><a
href='#index-_002d_002dinclude' class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-include-files"></span>
-<span id="index-searching-directory-trees-2"></span>
-<p>Search only files whose name matches <var>glob</var>,
-using wildcard matching as described under <samp>--exclude</samp>.
-If contradictory <samp>--include</samp> and <samp>--exclude</samp> options are
-given, the last matching one wins. If no <samp>--include</samp> or
-<samp>--exclude</samp> options match, a file is included unless the first
-such option is <samp>--include</samp>.
-</p>
-</dd>
-<dt id='index-_002dr'><span><samp>-r</samp><a href='#index-_002dr'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--recursive</samp></span></dt>
-<dd><span id="index-_002d_002drecursive"></span>
-<span id="index-recursive-search"></span>
-<span id="index-searching-directory-trees-3"></span>
-<span id="index-symbolic-links-1"></span>
+<dt><samp class="option">--include=<var class="var">glob</var></samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dinclude"></a>
+<a class="index-entry-id" id="index-include-files"></a>
+<a class="index-entry-id" id="index-searching-directory-trees-2"></a>
+<p>Search only files whose name matches <var class="var">glob</var>,
+using wildcard matching as described under <samp
class="option">--exclude</samp>.
+If contradictory <samp class="option">--include</samp> and <samp
class="option">--exclude</samp> options are
+given, the last matching one wins. If no <samp
class="option">--include</samp> or
+<samp class="option">--exclude</samp> options match, a file is included unless
the first
+such option is <samp class="option">--include</samp>.
+</p>
+</dd>
+<dt><samp class="option">-r</samp></dt>
+<dt><samp class="option">--recursive</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dr"></a>
+<a class="index-entry-id" id="index-_002d_002drecursive"></a>
+<a class="index-entry-id" id="index-recursive-search"></a>
+<a class="index-entry-id" id="index-searching-directory-trees-3"></a>
+<a class="index-entry-id" id="index-symbolic-links-1"></a>
<p>For each directory operand,
read and process all files in that directory, recursively.
Follow symbolic links on the command line, but skip symlinks
that are encountered recursively.
Note that if no file operand is given, grep searches the working directory.
-This is the same as the ‘<samp>--directories=recurse</samp>’
option.
+This is the same as the ‘<samp
class="samp">--directories=recurse</samp>’ option.
</p>
</dd>
-<dt id='index-_002dR'><span><samp>-R</samp><a href='#index-_002dR'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--dereference-recursive</samp></span></dt>
-<dd><span id="index-_002d_002ddereference_002drecursive"></span>
-<span id="index-recursive-search-1"></span>
-<span id="index-searching-directory-trees-4"></span>
-<span id="index-symbolic-links-2"></span>
+<dt><samp class="option">-R</samp></dt>
+<dt><samp class="option">--dereference-recursive</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dR"></a>
+<a class="index-entry-id" id="index-_002d_002ddereference_002drecursive"></a>
+<a class="index-entry-id" id="index-recursive-search-1"></a>
+<a class="index-entry-id" id="index-searching-directory-trees-4"></a>
+<a class="index-entry-id" id="index-symbolic-links-2"></a>
<p>For each directory operand, read and process all files in that
directory, recursively, following all symbolic links.
</p>
@@ -848,24 +887,26 @@
<hr>
</div>
-<div class="subsection" id="Other-Options">
-<div class="header">
+<div class="subsection-level-extent" id="Other-Options">
+<div class="nav-panel">
<p>
Previous: <a href="#File-and-Directory-Selection" accesskey="p"
rel="prev">File and Directory Selection</a>, Up: <a
href="#Command_002dline-Options" accesskey="u" rel="up">Command-line
Options</a> [<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Other-Options-1"></span><h4 class="subsection">2.1.7 Other
Options</h4>
+<h4 class="subsection" id="Other-Options-1"><span>2.1.7 Other Options<a
class="copiable-link" href="#Other-Options-1"> ¶</a></span></h4>
-<dl compact="compact">
-<dt id='index-_002d_002d'><span><samp>--</samp><a href='#index-_002d_002d'
class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-option-delimiter"></span>
+<dl class="table">
+<dt><samp class="option">--</samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002d"></a>
+<a class="index-entry-id" id="index-option-delimiter"></a>
<p>Delimit the option list. Later arguments, if any, are treated as
-operands even if they begin with ‘<samp>-</samp>’. For example,
‘<samp>grep PAT --
--file1 file2</samp>’ searches for the pattern PAT in the files named
<samp>-file1</samp>
-and <samp>file2</samp>.
+operands even if they begin with ‘<samp class="samp">-</samp>’.
For example, ‘<samp class="samp">grep PAT --
+-file1 file2</samp>’ searches for the pattern PAT in the files named
<samp class="file">-file1</samp>
+and <samp class="file">file2</samp>.
</p>
</dd>
-<dt
id='index-_002d_002dline_002dbuffered'><span><samp>--line-buffered</samp><a
href='#index-_002d_002dline_002dbuffered' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-line-buffering"></span>
+<dt><samp class="option">--line-buffered</samp></dt>
+<dd><a class="index-entry-id" id="index-_002d_002dline_002dbuffered"></a>
+<a class="index-entry-id" id="index-line-buffering"></a>
<p>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
@@ -873,41 +914,43 @@
flushed after every output line. The buffer size is system dependent.
</p>
</dd>
-<dt id='index-_002dU'><span><samp>-U</samp><a href='#index-_002dU'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--binary</samp></span></dt>
-<dd><span id="index-_002d_002dbinary"></span>
-<span id="index-MS_002dWindows-binary-I_002fO"></span>
-<span id="index-binary-I_002fO"></span>
+<dt><samp class="option">-U</samp></dt>
+<dt><samp class="option">--binary</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dU"></a>
+<a class="index-entry-id" id="index-_002d_002dbinary"></a>
+<a class="index-entry-id" id="index-MS_002dWindows-binary-I_002fO"></a>
+<a class="index-entry-id" id="index-binary-I_002fO"></a>
<p>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 <code>grep</code>
+as-is. This overrides the default behavior where <code
class="command">grep</code>
follows the operating system’s advice whether to use text or binary
-I/O. On MS-Windows when <code>grep</code> uses text I/O it reads a
+I/O. On MS-Windows when <code class="command">grep</code> uses 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.
</p>
-<p>When using text I/O <samp>--byte-offset</samp> (<samp>-b</samp>) counts and
-<samp>--binary-files</samp> heuristics apply to input data after text-I/O
-processing. Also, the <samp>--binary-files</samp> heuristics need not agree
-with the <samp>--binary</samp> option; that is, they may treat the data as
-text even if <samp>--binary</samp> is given, or vice versa.
-See <a href="#File-and-Directory-Selection">File and Directory Selection</a>.
+<p>When using text I/O <samp class="option">--byte-offset</samp> (<samp
class="option">-b</samp>) counts and
+<samp class="option">--binary-files</samp> heuristics apply to input data
after text-I/O
+processing. Also, the <samp class="option">--binary-files</samp> heuristics
need not agree
+with the <samp class="option">--binary</samp> option; that is, they may treat
the data as
+text even if <samp class="option">--binary</samp> is given, or vice versa.
+See <a class="xref" href="#File-and-Directory-Selection">File and Directory
Selection</a>.
</p>
<p>This option has no effect on GNU and other POSIX-compatible platforms,
which do not distinguish text from binary I/O.
</p>
</dd>
-<dt id='index-_002dz'><span><samp>-z</samp><a href='#index-_002dz'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--null-data</samp></span></dt>
-<dd><span id="index-_002d_002dnull_002ddata"></span>
-<span id="index-zero_002dterminated-lines"></span>
+<dt><samp class="option">-z</samp></dt>
+<dt><samp class="option">--null-data</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dz"></a>
+<a class="index-entry-id" id="index-_002d_002dnull_002ddata"></a>
+<a class="index-entry-id" id="index-zero_002dterminated-lines"></a>
<p>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 <samp>-Z</samp> or <samp>--null</samp> option,
+Like the <samp class="option">-Z</samp> or <samp class="option">--null</samp>
option,
this option can be used with commands like
-‘<samp>sort -z</samp>’ to process arbitrary file names.
+‘<samp class="samp">sort -z</samp>’ to process arbitrary file
names.
</p>
</dd>
</dl>
@@ -915,66 +958,67 @@
<hr>
</div>
</div>
-<div class="section" id="Environment-Variables">
-<div class="header">
+<div class="section-level-extent" id="Environment-Variables">
+<div class="nav-panel">
<p>
-Next: <a href="#Exit-Status" accesskey="n" rel="next">Exit Status</a>,
Previous: <a href="#Command_002dline-Options" accesskey="p"
rel="prev">Command-line Options</a>, Up: <a href="#Invoking" accesskey="u"
rel="up">Invoking <code>grep</code></a> [<a href="#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a href="#Index"
title="Index" rel="index">Index</a>]</p>
+Next: <a href="#Exit-Status" accesskey="n" rel="next">Exit Status</a>,
Previous: <a href="#Command_002dline-Options" accesskey="p"
rel="prev">Command-line Options</a>, Up: <a href="#Invoking" accesskey="u"
rel="up">Invoking <code class="command">grep</code></a> [<a
href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a
href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
-<span id="Environment-Variables-1"></span><h3 class="section">2.2 Environment
Variables</h3>
+<h3 class="section" id="Environment-Variables-1"><span>2.2 Environment
Variables<a class="copiable-link" href="#Environment-Variables-1">
¶</a></span></h3>
-<p>The behavior of <code>grep</code> is affected by several environment
+<p>The behavior of <code class="command">grep</code> is affected by several
environment
variables, the most important of which control the locale, which
-specifies how <code>grep</code> interprets characters in its patterns and
+specifies how <code class="command">grep</code> interprets characters in its
patterns and
data.
</p>
-<span id="index-LANGUAGE-environment-variable"></span>
-<span id="index-LC_005fALL-environment-variable"></span>
-<span id="index-LC_005fMESSAGES-environment-variable"></span>
-<span id="index-LANG-environment-variable"></span>
-<p>The locale for category <code><span
class="nolinebreak">LC_</span><var>foo</var></code><!-- /@w -->
+<a class="index-entry-id" id="index-LANGUAGE-environment-variable"></a>
+<a class="index-entry-id" id="index-LC_005fALL-environment-variable"></a>
+<a class="index-entry-id" id="index-LC_005fMESSAGES-environment-variable"></a>
+<a class="index-entry-id" id="index-LANG-environment-variable"></a>
+<p>The locale for category <code class="code">LC_<var
class="var">foo</var></code><!-- /@w -->
is specified by examining the three environment variables
-<code>LC_ALL</code>, <code><span
class="nolinebreak">LC_</span><var>foo</var></code><!-- /@w -->, and
<code>LANG</code>,
+<code class="env">LC_ALL</code>, <code class="env">LC_<var
class="var">foo</var></code><!-- /@w -->, and <code class="env">LANG</code>,
in that order.
The first of these variables that is set specifies the locale.
-For example, if <code>LC_ALL</code> is not set,
-but <code>LC_COLLATE</code> is set to ‘<samp>pt_BR.UTF-8</samp>’,
+For example, if <code class="env">LC_ALL</code> is not set,
+but <code class="env">LC_COLLATE</code> is set to ‘<samp
class="samp">pt_BR.UTF-8</samp>’,
then a Brazilian Portuguese locale is used
-for the <code>LC_COLLATE</code> category.
-As a special case for <code>LC_MESSAGES</code> only, the environment variable
-<code>LANGUAGE</code> can contain a colon-separated list of languages that
+for the <code class="env">LC_COLLATE</code> category.
+As a special case for <code class="env">LC_MESSAGES</code> only, the
environment variable
+<code class="env">LANGUAGE</code> can contain a colon-separated list of
languages that
overrides the three environment variables that ordinarily specify
-the <code>LC_MESSAGES</code> category.
-The ‘<samp>C</samp>’ locale is used if none of these environment
variables are set,
+the <code class="env">LC_MESSAGES</code> category.
+The ‘<samp class="samp">C</samp>’ locale is used if none of these
environment variables are set,
if the locale catalog is not installed,
-or if <code>grep</code> was not compiled
+or if <code class="command">grep</code> was not compiled
with national language support (NLS).
-The shell command <code>locale -a</code> lists locales that are currently
available.
+The shell command <code class="code">locale -a</code> lists locales that are
currently available.
</p>
-<span id="index-environment-variables"></span>
-<p>The following environment variables affect the behavior of
<code>grep</code>.
+<a class="index-entry-id" id="index-environment-variables"></a>
+<p>The following environment variables affect the behavior of <code
class="command">grep</code>.
</p>
-<dl compact="compact">
-<dt
id='index-GREP_005fCOLOR-environment-variable'><span><code>GREP_COLOR</code><a
href='#index-GREP_005fCOLOR-environment-variable' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-highlight-markers"></span>
-<p>This obsolescent variable interacts with <code>GREP_COLORS</code>
-confusingly, and <code>grep</code> warns if it is set and is not
-overridden by <code>GREP_COLORS</code>. Instead of
-‘<samp>GREP_COLOR='<var>color</var>'</samp>’, you can use
-‘<samp>GREP_COLORS='mt=<var>color</var>'</samp>’.
-</p>
-</dd>
-<dt
id='index-GREP_005fCOLORS-environment-variable'><span><code>GREP_COLORS</code><a
href='#index-GREP_005fCOLORS-environment-variable' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-highlight-markers-1"></span>
-<p>This variable specifies the colors and other attributes
-used to highlight various parts of the output.
-Its value is a colon-separated list of <code>terminfo</code> capabilities
-that defaults to
‘<samp>ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36</samp>’
-with the ‘<samp>rv</samp>’ and ‘<samp>ne</samp>’
boolean capabilities omitted (i.e., false).
+<dl class="table">
+<dt><code class="env">GREP_COLOR</code></dt>
+<dd><a class="index-entry-id"
id="index-GREP_005fCOLOR-environment-variable"></a>
+<a class="index-entry-id" id="index-highlight-markers"></a>
+<p>This obsolescent variable interacts with <code
class="env">GREP_COLORS</code>
+confusingly, and <code class="command">grep</code> warns if it is set and is
not
+overridden by <code class="env">GREP_COLORS</code>. Instead of
+‘<samp class="samp">GREP_COLOR='<var
class="var">color</var>'</samp>’, you can use
+‘<samp class="samp">GREP_COLORS='mt=<var
class="var">color</var>'</samp>’.
+</p>
+</dd>
+<dt><code class="env">GREP_COLORS</code></dt>
+<dd><a class="index-entry-id"
id="index-GREP_005fCOLORS-environment-variable"></a>
+<a class="index-entry-id" id="index-highlight-markers-1"></a>
+<p>This variable controls how the <samp class="option">--color</samp> option
highlights output.
+Its value is a colon-separated list of <code class="code">terminfo</code>
capabilities
+that defaults to ‘<samp
class="samp">ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36</samp>’
+with the ‘<samp class="samp">rv</samp>’ and ‘<samp
class="samp">ne</samp>’ boolean capabilities omitted (i.e., false).
The two-letter capability names
refer to terminal “capabilities,” the ability
of a terminal to highlight text, or change its color, and so on.
These capabilities are stored in an online database and accessed by
-the <code>terminfo</code> library.
+the <code class="code">terminfo</code> library.
Non-empty capability values
control highlighting using
Select Graphic Rendition (SGR)
@@ -985,171 +1029,186 @@
for permitted values and their meanings as character attributes.)
These substring values are integers in decimal representation
and can be concatenated with semicolons.
-<code>grep</code> takes care of assembling the result
-into a complete SGR sequence
(‘<samp>\33[</samp>’...‘<samp>m</samp>’).
+<code class="command">grep</code> takes care of assembling the result
+into a complete SGR sequence (‘<samp
class="samp">\33[</samp>’...‘<samp class="samp">m</samp>’).
Common values to concatenate include
-‘<samp>1</samp>’ for bold,
-‘<samp>4</samp>’ for underline,
-‘<samp>5</samp>’ for blink,
-‘<samp>7</samp>’ for inverse,
-‘<samp>39</samp>’ for default foreground color,
-‘<samp>30</samp>’ to ‘<samp>37</samp>’ for foreground
colors,
-‘<samp>90</samp>’ to ‘<samp>97</samp>’ for 16-color
mode foreground colors,
-‘<samp>38;5;0</samp>’ to ‘<samp>38;5;255</samp>’
+‘<samp class="samp">1</samp>’ for bold,
+‘<samp class="samp">4</samp>’ for underline,
+‘<samp class="samp">5</samp>’ for blink,
+‘<samp class="samp">7</samp>’ for inverse,
+‘<samp class="samp">39</samp>’ for default foreground color,
+‘<samp class="samp">30</samp>’ to ‘<samp
class="samp">37</samp>’ for foreground colors,
+‘<samp class="samp">90</samp>’ to ‘<samp
class="samp">97</samp>’ for 16-color mode foreground colors,
+‘<samp class="samp">38;5;0</samp>’ to ‘<samp
class="samp">38;5;255</samp>’
for 88-color and 256-color modes foreground colors,
-‘<samp>49</samp>’ for default background color,
-‘<samp>40</samp>’ to ‘<samp>47</samp>’ for background
colors,
-‘<samp>100</samp>’ to ‘<samp>107</samp>’ for 16-color
mode background colors,
-and ‘<samp>48;5;0</samp>’ to ‘<samp>48;5;255</samp>’
+‘<samp class="samp">49</samp>’ for default background color,
+‘<samp class="samp">40</samp>’ to ‘<samp
class="samp">47</samp>’ for background colors,
+‘<samp class="samp">100</samp>’ to ‘<samp
class="samp">107</samp>’ for 16-color mode background colors,
+and ‘<samp class="samp">48;5;0</samp>’ to ‘<samp
class="samp">48;5;255</samp>’
for 88-color and 256-color modes background colors.
</p>
<p>Supported capabilities are as follows.
</p>
-<dl compact="compact">
-<dt id='index-sl-GREP_005fCOLORS-capability'><span><code>sl=</code><a
href='#index-sl-GREP_005fCOLORS-capability' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>SGR substring for whole selected lines
+<dl class="table">
+<dt><code class="code">sl=</code></dt>
+<dd><a class="index-entry-id" id="index-sl-GREP_005fCOLORS-capability"></a>
+<p>SGR substring for whole selected lines
(i.e.,
-matching lines when the <samp>-v</samp> command-line option is omitted,
-or non-matching lines when <samp>-v</samp> is specified).
-If however the boolean ‘<samp>rv</samp>’ capability
-and the <samp>-v</samp> command-line option are both specified,
+matching lines when the <samp class="option">-v</samp> command-line option is
omitted,
+or non-matching lines when <samp class="option">-v</samp> is specified).
+If however the boolean ‘<samp class="samp">rv</samp>’ capability
+and the <samp class="option">-v</samp> command-line option are both specified,
it applies to context matching lines instead.
The default is empty (i.e., the terminal’s default color pair).
</p>
</dd>
-<dt id='index-cx-GREP_005fCOLORS-capability'><span><code>cx=</code><a
href='#index-cx-GREP_005fCOLORS-capability' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>SGR substring for whole context lines
+<dt><code class="code">cx=</code></dt>
+<dd><a class="index-entry-id" id="index-cx-GREP_005fCOLORS-capability"></a>
+<p>SGR substring for whole context lines
(i.e.,
-non-matching lines when the <samp>-v</samp> command-line option is omitted,
-or matching lines when <samp>-v</samp> is specified).
-If however the boolean ‘<samp>rv</samp>’ capability
-and the <samp>-v</samp> command-line option are both specified,
+non-matching lines when the <samp class="option">-v</samp> command-line option
is omitted,
+or matching lines when <samp class="option">-v</samp> is specified).
+If however the boolean ‘<samp class="samp">rv</samp>’ capability
+and the <samp class="option">-v</samp> command-line option are both specified,
it applies to selected non-matching lines instead.
The default is empty (i.e., the terminal’s default color pair).
</p>
</dd>
-<dt id='index-rv-GREP_005fCOLORS-capability'><span><code>rv</code><a
href='#index-rv-GREP_005fCOLORS-capability' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>Boolean value that reverses (swaps) the meanings of
-the ‘<samp>sl=</samp>’ and ‘<samp>cx=</samp>’
capabilities
-when the <samp>-v</samp> command-line option is specified.
+<dt><code class="code">rv</code></dt>
+<dd><a class="index-entry-id" id="index-rv-GREP_005fCOLORS-capability"></a>
+<p>Boolean value that reverses (swaps) the meanings of
+the ‘<samp class="samp">sl=</samp>’ and ‘<samp
class="samp">cx=</samp>’ capabilities
+when the <samp class="option">-v</samp> command-line option is specified.
The default is false (i.e., the capability is omitted).
</p>
</dd>
-<dt id='index-mt-GREP_005fCOLORS-capability'><span><code>mt=01;31</code><a
href='#index-mt-GREP_005fCOLORS-capability' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>SGR substring for matching non-empty text in any matching line
+<dt><code class="code">mt=01;31</code></dt>
+<dd><a class="index-entry-id" id="index-mt-GREP_005fCOLORS-capability"></a>
+<p>SGR substring for matching non-empty text in any matching line
(i.e.,
-a selected line when the <samp>-v</samp> command-line option is omitted,
-or a context line when <samp>-v</samp> is specified).
-Setting this is equivalent to setting both ‘<samp>ms=</samp>’ and
‘<samp>mc=</samp>’
+a selected line when the <samp class="option">-v</samp> command-line option is
omitted,
+or a context line when <samp class="option">-v</samp> is specified).
+Setting this is equivalent to setting both ‘<samp
class="samp">ms=</samp>’ and ‘<samp class="samp">mc=</samp>’
at once to the same value.
The default is a bold red text foreground over the current line background.
</p>
</dd>
-<dt id='index-ms-GREP_005fCOLORS-capability'><span><code>ms=01;31</code><a
href='#index-ms-GREP_005fCOLORS-capability' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>SGR substring for matching non-empty text in a selected line.
-(This is used only when the <samp>-v</samp> command-line option is omitted.)
-The effect of the ‘<samp>sl=</samp>’ (or
‘<samp>cx=</samp>’ if ‘<samp>rv</samp>’) capability
+<dt><code class="code">ms=01;31</code></dt>
+<dd><a class="index-entry-id" id="index-ms-GREP_005fCOLORS-capability"></a>
+<p>SGR substring for matching non-empty text in a selected line.
+(This is used only when the <samp class="option">-v</samp> command-line option
is omitted.)
+The effect of the ‘<samp class="samp">sl=</samp>’ (or ‘<samp
class="samp">cx=</samp>’ if ‘<samp class="samp">rv</samp>’)
capability
remains active when this takes effect.
The default is a bold red text foreground over the current line background.
</p>
</dd>
-<dt id='index-mc-GREP_005fCOLORS-capability'><span><code>mc=01;31</code><a
href='#index-mc-GREP_005fCOLORS-capability' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>SGR substring for matching non-empty text in a context line.
-(This is used only when the <samp>-v</samp> command-line option is specified.)
-The effect of the ‘<samp>cx=</samp>’ (or
‘<samp>sl=</samp>’ if ‘<samp>rv</samp>’) capability
+<dt><code class="code">mc=01;31</code></dt>
+<dd><a class="index-entry-id" id="index-mc-GREP_005fCOLORS-capability"></a>
+<p>SGR substring for matching non-empty text in a context line.
+(This is used only when the <samp class="option">-v</samp> command-line option
is specified.)
+The effect of the ‘<samp class="samp">cx=</samp>’ (or ‘<samp
class="samp">sl=</samp>’ if ‘<samp class="samp">rv</samp>’)
capability
remains active when this takes effect.
The default is a bold red text foreground over the current line background.
</p>
</dd>
-<dt id='index-fn-GREP_005fCOLORS-capability'><span><code>fn=35</code><a
href='#index-fn-GREP_005fCOLORS-capability' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>SGR substring for file names prefixing any content line.
+<dt><code class="code">fn=35</code></dt>
+<dd><a class="index-entry-id" id="index-fn-GREP_005fCOLORS-capability"></a>
+<p>SGR substring for file names prefixing any content line.
The default is a magenta text foreground over the terminal’s default
background.
</p>
</dd>
-<dt id='index-ln-GREP_005fCOLORS-capability'><span><code>ln=32</code><a
href='#index-ln-GREP_005fCOLORS-capability' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>SGR substring for line numbers prefixing any content line.
+<dt><code class="code">ln=32</code></dt>
+<dd><a class="index-entry-id" id="index-ln-GREP_005fCOLORS-capability"></a>
+<p>SGR substring for line numbers prefixing any content line.
The default is a green text foreground over the terminal’s default
background.
</p>
</dd>
-<dt id='index-bn-GREP_005fCOLORS-capability'><span><code>bn=32</code><a
href='#index-bn-GREP_005fCOLORS-capability' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>SGR substring for byte offsets prefixing any content line.
+<dt><code class="code">bn=32</code></dt>
+<dd><a class="index-entry-id" id="index-bn-GREP_005fCOLORS-capability"></a>
+<p>SGR substring for byte offsets prefixing any content line.
The default is a green text foreground over the terminal’s default
background.
</p>
</dd>
-<dt id='index-fn-GREP_005fCOLORS-capability-1'><span><code>se=36</code><a
href='#index-fn-GREP_005fCOLORS-capability-1' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>SGR substring for separators that are inserted
-between selected line fields (‘<samp>:</samp>’),
-between context line fields (‘<samp>-</samp>’),
+<dt><code class="code">se=36</code></dt>
+<dd><a class="index-entry-id" id="index-fn-GREP_005fCOLORS-capability-1"></a>
+<p>SGR substring for separators that are inserted
+between selected line fields (‘<samp class="samp">:</samp>’),
+between context line fields (‘<samp class="samp">-</samp>’),
and between groups of adjacent lines
-when nonzero context is specified (‘<samp>--</samp>’).
+when nonzero context is specified (‘<samp class="samp">--</samp>’).
The default is a cyan text foreground over the terminal’s default
background.
</p>
</dd>
-<dt id='index-ne-GREP_005fCOLORS-capability'><span><code>ne</code><a
href='#index-ne-GREP_005fCOLORS-capability' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>Boolean value that prevents clearing to the end of line
-using Erase in Line (EL) to Right (‘<samp>\33[K</samp>’)
+<dt><code class="code">ne</code></dt>
+<dd><a class="index-entry-id" id="index-ne-GREP_005fCOLORS-capability"></a>
+<p>Boolean value that prevents clearing to the end of line
+using Erase in Line (EL) to Right (‘<samp
class="samp">\33[K</samp>’)
each time a colorized item ends.
This is needed on terminals on which EL is not supported.
It is otherwise useful on terminals
-for which the <code>back_color_erase</code>
-(<code>bce</code>) boolean <code>terminfo</code> capability does not apply,
+for which the <code class="code">back_color_erase</code>
+(<code class="code">bce</code>) boolean <code class="code">terminfo</code>
capability does not apply,
when the chosen highlight colors do not affect the background,
or when EL is too slow or causes too much flicker.
The default is false (i.e., the capability is omitted).
</p></dd>
</dl>
-<p>Note that boolean capabilities have no ‘<samp>=</samp>’... part.
+<p>Note that boolean capabilities have no ‘<samp
class="samp">=</samp>’... part.
They are omitted (i.e., false) by default and become true when specified.
</p>
</dd>
-<dt id='index-LC_005fALL-environment-variable-1'><span><code>LC_ALL</code><a
href='#index-LC_005fALL-environment-variable-1' class='copiable-anchor'>
¶</a></span></dt>
-<dt><span><code>LC_COLLATE</code></span></dt>
-<dt><span><code>LANG</code></span></dt>
-<dd><span id="index-LC_005fCOLLATE-environment-variable"></span>
-<span id="index-LANG-environment-variable-1"></span>
-<span id="index-character-type"></span>
-<span id="index-national-language-support"></span>
-<span id="index-NLS"></span>
-<p>These variables specify the locale for the <code>LC_COLLATE</code> category,
-which might affect how range expressions like ‘<samp>a-z</samp>’
are
+<dt><code class="env">LC_ALL</code></dt>
+<dt><code class="env">LC_COLLATE</code></dt>
+<dt><code class="env">LANG</code></dt>
+<dd><a class="index-entry-id" id="index-LC_005fALL-environment-variable-1"></a>
+<a class="index-entry-id" id="index-LC_005fCOLLATE-environment-variable"></a>
+<a class="index-entry-id" id="index-LANG-environment-variable-1"></a>
+<a class="index-entry-id" id="index-character-type"></a>
+<a class="index-entry-id" id="index-national-language-support"></a>
+<a class="index-entry-id" id="index-NLS"></a>
+<p>These variables specify the locale for the <code
class="env">LC_COLLATE</code> category,
+which might affect how range expressions like ‘<samp
class="samp">a-z</samp>’ are
interpreted.
</p>
</dd>
-<dt id='index-LC_005fALL-environment-variable-2'><span><code>LC_ALL</code><a
href='#index-LC_005fALL-environment-variable-2' class='copiable-anchor'>
¶</a></span></dt>
-<dt><span><code>LC_CTYPE</code></span></dt>
-<dt><span><code>LANG</code></span></dt>
-<dd><span id="index-LC_005fCTYPE-environment-variable"></span>
-<span id="index-LANG-environment-variable-2"></span>
-<span id="index-encoding-error"></span>
-<span id="index-null-character"></span>
-<p>These variables specify the locale for the <code>LC_CTYPE</code> category,
+<dt><code class="env">LC_ALL</code></dt>
+<dt><code class="env">LC_CTYPE</code></dt>
+<dt><code class="env">LANG</code></dt>
+<dd><a class="index-entry-id" id="index-LC_005fALL-environment-variable-2"></a>
+<a class="index-entry-id" id="index-LC_005fCTYPE-environment-variable"></a>
+<a class="index-entry-id" id="index-LANG-environment-variable-2"></a>
+<a class="index-entry-id" id="index-encoding-error"></a>
+<a class="index-entry-id" id="index-null-character"></a>
+<p>These variables specify the locale for the <code
class="env">LC_CTYPE</code> category,
which determines the type of characters,
e.g., which characters are whitespace.
This category also determines the character encoding.
-See <a href="#Character-Encoding">Character Encoding</a>.
+See <a class="xref" href="#Character-Encoding">Character Encoding</a>.
</p>
</dd>
-<dt id='index-LANGUAGE-environment-variable-1'><span><code>LANGUAGE</code><a
href='#index-LANGUAGE-environment-variable-1' class='copiable-anchor'>
¶</a></span></dt>
-<dt><span><code>LC_ALL</code></span></dt>
-<dt><span><code>LC_MESSAGES</code></span></dt>
-<dt><span><code>LANG</code></span></dt>
-<dd><span id="index-LC_005fALL-environment-variable-3"></span>
-<span id="index-LC_005fMESSAGES-environment-variable-1"></span>
-<span id="index-LANG-environment-variable-3"></span>
-<span id="index-language-of-messages"></span>
-<span id="index-message-language"></span>
-<span id="index-national-language-support-1"></span>
-<span id="index-translation-of-message-language"></span>
-<p>These variables specify the locale for the <code>LC_MESSAGES</code>
category,
-which determines the language that <code>grep</code> uses for messages.
-The default ‘<samp>C</samp>’ locale uses American English messages.
-</p>
-</dd>
-<dt
id='index-POSIXLY_005fCORRECT-environment-variable'><span><code>POSIXLY_CORRECT</code><a
href='#index-POSIXLY_005fCORRECT-environment-variable'
class='copiable-anchor'> ¶</a></span></dt>
-<dd><p>If set, <code>grep</code> behaves as POSIX requires; otherwise,
-<code>grep</code> behaves more like other GNU programs.
+<dt><code class="env">LANGUAGE</code></dt>
+<dt><code class="env">LC_ALL</code></dt>
+<dt><code class="env">LC_MESSAGES</code></dt>
+<dt><code class="env">LANG</code></dt>
+<dd><a class="index-entry-id" id="index-LANGUAGE-environment-variable-1"></a>
+<a class="index-entry-id" id="index-LC_005fALL-environment-variable-3"></a>
+<a class="index-entry-id"
id="index-LC_005fMESSAGES-environment-variable-1"></a>
+<a class="index-entry-id" id="index-LANG-environment-variable-3"></a>
+<a class="index-entry-id" id="index-language-of-messages"></a>
+<a class="index-entry-id" id="index-message-language"></a>
+<a class="index-entry-id" id="index-national-language-support-1"></a>
+<a class="index-entry-id" id="index-translation-of-message-language"></a>
+<p>These variables specify the locale for the <code
class="env">LC_MESSAGES</code> category,
+which determines the language that <code class="command">grep</code> uses for
messages.
+The default ‘<samp class="samp">C</samp>’ locale uses American
English messages.
+</p>
+</dd>
+<dt><code class="env">POSIXLY_CORRECT</code></dt>
+<dd><a class="index-entry-id"
id="index-POSIXLY_005fCORRECT-environment-variable"></a>
+<p>If set, <code class="command">grep</code> behaves as POSIX requires;
otherwise,
+<code class="command">grep</code> behaves more like other GNU programs.
POSIX
requires that options that
follow file names must be treated as file names;
@@ -1158,35 +1217,24 @@
and are treated as options.
</p>
</dd>
-<dt id='index-TERM-environment-variable'><span><code>TERM</code><a
href='#index-TERM-environment-variable' class='copiable-anchor'>
¶</a></span></dt>
-<dd><p>This variable specifies the output terminal type, which can affect
-what the <samp>--color</samp> option does. See <a
href="#General-Output-Control">General Output Control</a>.
-</p>
-</dd>
-<dt
id='index-_005fN_005fGNU_005fnonoption_005fargv_005fflags_005f-environment-variable'><span><code>_<var>N</var>_GNU_nonoption_argv_flags_</code><a
href='#index-_005fN_005fGNU_005fnonoption_005fargv_005fflags_005f-environment-variable'
class='copiable-anchor'> ¶</a></span></dt>
-<dd><p>(Here <code><var>N</var></code> is <code>grep</code>’s numeric
process ID.)
-If the <var>i</var>th character of this environment variable’s value is
‘<samp>1</samp>’,
-do not consider the <var>i</var>th operand of <code>grep</code> to be an
option,
-even if it appears to be one.
-A shell can put this variable in the environment for each command it runs,
-specifying which operands are the results of file name wildcard expansion
-and therefore should not be treated as options.
-This behavior is available only with the GNU C library,
-and only when <code>POSIXLY_CORRECT</code> is not set.
+<dt><code class="env">TERM</code></dt>
+<dd><a class="index-entry-id" id="index-TERM-environment-variable"></a>
+<p>This variable specifies the output terminal type, which can affect
+what the <samp class="option">--color</samp> option does. See <a class="xref"
href="#General-Output-Control">General Output Control</a>.
</p>
</dd>
</dl>
-<p>The <code>GREP_OPTIONS</code> environment variable of <code>grep</code>
2.20 and
+<p>The <code class="env">GREP_OPTIONS</code> environment variable of <code
class="command">grep</code> 2.20 and
earlier is no longer supported, as it caused problems when writing
-portable scripts. To make arbitrary changes to how <code>grep</code>
+portable scripts. To make arbitrary changes to how <code
class="command">grep</code>
works, you can use an alias or script instead. For example, if
-<code>grep</code> is in the directory ‘<samp>/usr/bin</samp>’ you
can prepend
-<samp>$HOME/bin</samp> to your <code>PATH</code> and create an executable
script
-<samp>$HOME/bin/grep</samp> containing the following:
+<code class="command">grep</code> is in the directory ‘<samp
class="samp">/usr/bin</samp>’ you can prepend
+<samp class="file">$HOME/bin</samp> to your <code class="env">PATH</code> and
create an executable script
+<samp class="file">$HOME/bin/grep</samp> containing the following:
</p>
<div class="example">
-<pre class="example">#! /bin/sh
+<pre class="example-preformatted">#! /bin/sh
export PATH=/usr/bin
exec grep --color=auto --devices=skip "$@"
</pre></div>
@@ -1194,78 +1242,114 @@
<hr>
</div>
-<div class="section" id="Exit-Status">
-<div class="header">
+<div class="section-level-extent" id="Exit-Status">
+<div class="nav-panel">
<p>
-Next: <a href="#grep-Programs" accesskey="n" rel="next"><code>grep</code>
Programs</a>, Previous: <a href="#Environment-Variables" accesskey="p"
rel="prev">Environment Variables</a>, Up: <a href="#Invoking" accesskey="u"
rel="up">Invoking <code>grep</code></a> [<a href="#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a href="#Index"
title="Index" rel="index">Index</a>]</p>
+Next: <a href="#grep-Programs" accesskey="n" rel="next"><code
class="command">grep</code> Programs</a>, Previous: <a
href="#Environment-Variables" accesskey="p" rel="prev">Environment
Variables</a>, Up: <a href="#Invoking" accesskey="u" rel="up">Invoking <code
class="command">grep</code></a> [<a href="#SEC_Contents" title="Table of
contents" rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Exit-Status-1"></span><h3 class="section">2.3 Exit Status</h3>
-<span id="index-exit-status"></span>
-<span id="index-return-status"></span>
+<h3 class="section" id="Exit-Status-1"><span>2.3 Exit Status<a
class="copiable-link" href="#Exit-Status-1"> ¶</a></span></h3>
+<a class="index-entry-id" id="index-exit-status"></a>
+<a class="index-entry-id" id="index-return-status"></a>
<p>Normally the exit status is 0 if a line is selected, 1 if no lines
were selected, and 2 if an error occurred. However, if the
-<samp>-q</samp> or <samp>--quiet</samp> or <samp>--silent</samp> option is used
+<samp class="option">-q</samp> or <samp class="option">--quiet</samp> or <samp
class="option">--silent</samp> option is used
and a line is selected, the exit status is 0 even if an error
-occurred. Other <code>grep</code> implementations may exit with status
+occurred. Other <code class="command">grep</code> implementations may exit
with status
greater than 2 on error.
</p>
<hr>
</div>
-<div class="section" id="grep-Programs">
-<div class="header">
+<div class="section-level-extent" id="grep-Programs">
+<div class="nav-panel">
<p>
-Previous: <a href="#Exit-Status" accesskey="p" rel="prev">Exit Status</a>, Up:
<a href="#Invoking" accesskey="u" rel="up">Invoking <code>grep</code></a>
[<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
+Previous: <a href="#Exit-Status" accesskey="p" rel="prev">Exit Status</a>, Up:
<a href="#Invoking" accesskey="u" rel="up">Invoking <code
class="command">grep</code></a> [<a href="#SEC_Contents" title="Table of
contents" rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="grep-Programs-1"></span><h3 class="section">2.4 <code>grep</code>
Programs</h3>
-<span id="index-grep-programs"></span>
-<span id="index-variants-of-grep"></span>
+<h3 class="section" id="grep-Programs-1"><span>2.4 <code
class="command">grep</code> Programs<a class="copiable-link"
href="#grep-Programs-1"> ¶</a></span></h3>
+<a class="index-entry-id" id="index-grep-programs"></a>
+<a class="index-entry-id" id="index-variants-of-grep"></a>
-<p><code>grep</code> searches the named input files
+<p><code class="command">grep</code> searches the named input files
for lines containing a match to the given patterns.
-By default, <code>grep</code> prints the matching lines.
-A file named <samp>-</samp> stands for standard input.
-If no input is specified, <code>grep</code> searches the working
-directory <samp>.</samp> if given a command-line option specifying
-recursion; otherwise, <code>grep</code> searches standard input.
-There are four major variants of <code>grep</code>,
+By default, <code class="command">grep</code> prints the matching lines.
+A file named <samp class="file">-</samp> stands for standard input.
+If no input is specified, <code class="command">grep</code> searches the
working
+directory <samp class="file">.</samp> if given a command-line option specifying
+recursion; otherwise, <code class="command">grep</code> searches standard
input.
+There are four major variants of <code class="command">grep</code>,
controlled by the following options.
</p>
-<dl compact="compact">
-<dt id='index-_002dG'><span><samp>-G</samp><a href='#index-_002dG'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--basic-regexp</samp></span></dt>
-<dd><span id="index-_002d_002dbasic_002dregexp"></span>
-<span id="index-matching-basic-regular-expressions"></span>
+<dl class="table">
+<dt><samp class="option">-G</samp></dt>
+<dt><samp class="option">--basic-regexp</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dG"></a>
+<a class="index-entry-id" id="index-_002d_002dbasic_002dregexp"></a>
+<a class="index-entry-id" id="index-matching-basic-regular-expressions"></a>
<p>Interpret patterns as basic regular expressions (BREs).
This is the default.
</p>
</dd>
-<dt id='index-_002dE'><span><samp>-E</samp><a href='#index-_002dE'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--extended-regexp</samp></span></dt>
-<dd><span id="index-_002d_002dextended_002dregexp"></span>
-<span id="index-matching-extended-regular-expressions"></span>
+<dt><samp class="option">-E</samp></dt>
+<dt><samp class="option">--extended-regexp</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dE"></a>
+<a class="index-entry-id" id="index-_002d_002dextended_002dregexp"></a>
+<a class="index-entry-id" id="index-matching-extended-regular-expressions"></a>
<p>Interpret patterns as extended regular expressions (EREs).
-(<samp>-E</samp> is specified by POSIX.)
+(<samp class="option">-E</samp> is specified by POSIX.)
</p>
</dd>
-<dt id='index-_002dF'><span><samp>-F</samp><a href='#index-_002dF'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--fixed-strings</samp></span></dt>
-<dd><span id="index-_002d_002dfixed_002dstrings"></span>
-<span id="index-matching-fixed-strings"></span>
+<dt><samp class="option">-F</samp></dt>
+<dt><samp class="option">--fixed-strings</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dF"></a>
+<a class="index-entry-id" id="index-_002d_002dfixed_002dstrings"></a>
+<a class="index-entry-id" id="index-matching-fixed-strings"></a>
<p>Interpret patterns as fixed strings, not regular expressions.
-(<samp>-F</samp> is specified by POSIX.)
+(<samp class="option">-F</samp> is specified by POSIX.)
</p>
</dd>
-<dt id='index-_002dP'><span><samp>-P</samp><a href='#index-_002dP'
class='copiable-anchor'> ¶</a></span></dt>
-<dt><span><samp>--perl-regexp</samp></span></dt>
-<dd><span id="index-_002d_002dperl_002dregexp"></span>
-<span id="index-matching-Perl_002dcompatible-regular-expressions"></span>
+<dt><samp class="option">-P</samp></dt>
+<dt><samp class="option">--perl-regexp</samp></dt>
+<dd><a class="index-entry-id" id="index-_002dP"></a>
+<a class="index-entry-id" id="index-_002d_002dperl_002dregexp"></a>
+<a class="index-entry-id"
id="index-matching-Perl_002dcompatible-regular-expressions"></a>
<p>Interpret patterns as Perl-compatible regular expressions (PCREs).
PCRE support is here to stay, but consider this option experimental when
-combined with the <samp>-z</samp> (<samp>--null-data</samp>) option, and note
that
-‘<samp>grep -P</samp>’ may warn of unimplemented features.
-See <a href="#Other-Options">Other Options</a>.
-</p>
+combined with the <samp class="option">-z</samp> (<samp
class="option">--null-data</samp>) option, and note that
+‘<samp class="samp">grep -P</samp>’ may warn of unimplemented
features.
+See <a class="xref" href="#Other-Options">Other Options</a>.
+</p>
+<p>For documentation, refer to <a class="url"
href="https://www.pcre.org/";>https://www.pcre.org/</a>, with these caveats:
+</p><ul class="itemize mark-bullet">
+<li>‘<samp class="samp">\d</samp>’ matches only the ten ASCII
digits
+(and ‘<samp class="samp">\D</samp>’ matches the complement),
regardless of locale.
+Use ‘<samp class="samp">\p{Nd}</samp>’ to also match non-ASCII
digits.
+
+<p>When <code class="command">grep</code> is built with PCRE2 10.42 and
earlier,
+‘<samp class="samp">\d</samp>’ and ‘<samp
class="samp">\D</samp>’ ignore in-regexp directives like ‘<samp
class="samp">(?aD)</samp>’
+and work like ‘<samp class="samp">[0-9]</samp>’ and ‘<samp
class="samp">[^0-9]</samp>’ respectively.
+However, later versions of PCRE2 likely will fix this,
+and the plan is for <code class="command">grep</code> to respect those
directives if possible.
+</p>
+</li><li>Although PCRE tracks the syntax and semantics of Perl’s regular
+expressions, the match is not always exact, partly because Perl
+evolves and a Perl installation may predate or postdate the PCRE2
+installation on the same host.
+
+</li><li>By default, <code class="command">grep</code> applies each regexp to
a line at a time,
+so the ‘<samp class="samp">(?s)</samp>’ directive (making
‘<samp class="samp">.</samp>’ match line breaks)
+is generally ineffective.
+However, with <samp class="option">-z</samp> (<samp
class="option">--null-data</samp>) it can work:
+<div class="example">
+<pre class="example-preformatted">$ printf 'a\nb\n' |grep -zP '(?s)a.b'
+a
+b
+</pre></div>
+<p>But beware: with the <samp class="option">-z</samp> (<samp
class="option">--null-data</samp>) and a file
+containing no NUL byte, grep must read the entire file into memory
+before processing any of it.
+Thus, it will exhaust memory and fail for some large files.
+</p></li></ul>
+
</dd>
</dl>
@@ -1273,32 +1357,33 @@
<hr>
</div>
</div>
-<div class="chapter" id="Regular-Expressions">
-<div class="header">
+<div class="chapter-level-extent" id="Regular-Expressions">
+<div class="nav-panel">
<p>
-Next: <a href="#Usage" accesskey="n" rel="next">Usage</a>, Previous: <a
href="#Invoking" accesskey="p" rel="prev">Invoking <code>grep</code></a>, Up:
<a href="#Top" accesskey="u" rel="up">grep</a> [<a href="#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a href="#Index"
title="Index" rel="index">Index</a>]</p>
+Next: <a href="#Usage" accesskey="n" rel="next">Usage</a>, Previous: <a
href="#Invoking" accesskey="p" rel="prev">Invoking <code
class="command">grep</code></a>, Up: <a href="#Top" accesskey="u"
rel="up">grep</a> [<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Regular-Expressions-1"></span><h2 class="chapter">3 Regular
Expressions</h2>
-<span id="index-regular-expressions"></span>
+<h2 class="chapter" id="Regular-Expressions-1"><span>3 Regular Expressions<a
class="copiable-link" href="#Regular-Expressions-1"> ¶</a></span></h2>
+<a class="index-entry-id" id="index-regular-expressions"></a>
-<p>A <em>regular expression</em> is a pattern that describes a set of strings.
+<p>A <em class="dfn">regular expression</em> is a pattern that describes a set
of strings.
Regular expressions are constructed analogously to arithmetic expressions,
by using various operators to combine smaller expressions.
-<code>grep</code> understands
+<code class="command">grep</code> understands
three different versions of regular expression syntax:
basic (BRE), extended (ERE), and Perl-compatible (PCRE).
-In GNU <code>grep</code>,
-there is no difference in available functionality between basic and
-extended syntax.
-In other implementations, basic regular expressions are less powerful.
+In GNU <code class="command">grep</code>,
+basic and extended regular expressions are merely different notations
+for the same pattern-matching functionality.
+In other implementations, basic regular expressions are ordinarily
+less powerful than extended, though occasionally it is the other way around.
The following description applies to extended regular expressions;
differences for basic regular expressions are summarized afterwards.
-Perl-compatible regular expressions give additional functionality, and
-are documented in the <i>pcre2syntax</i>(3) and <i>pcre2pattern</i>(3) manual
+Perl-compatible regular expressions have different functionality, and
+are documented in the <i class="i">pcre2syntax</i>(3) and <i
class="i">pcre2pattern</i>(3) manual
pages, but work only if PCRE is available in the system.
</p>
-<ul class="section-toc">
+<ul class="mini-toc">
<li><a href="#Fundamental-Structure" accesskey="1">Fundamental
Structure</a></li>
<li><a href="#Character-Classes-and-Bracket-Expressions"
accesskey="2">Character Classes and Bracket Expressions</a></li>
<li><a href="#Special-Backslash-Expressions" accesskey="3">Special Backslash
Expressions</a></li>
@@ -1310,74 +1395,81 @@
<li><a href="#Matching-Non_002dASCII" accesskey="9">Matching Non-ASCII and
Non-printable Characters</a></li>
</ul>
<hr>
-<div class="section" id="Fundamental-Structure">
-<div class="header">
+<div class="section-level-extent" id="Fundamental-Structure">
+<div class="nav-panel">
<p>
Next: <a href="#Character-Classes-and-Bracket-Expressions" accesskey="n"
rel="next">Character Classes and Bracket Expressions</a>, Up: <a
href="#Regular-Expressions" accesskey="u" rel="up">Regular Expressions</a>
[<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Fundamental-Structure-1"></span><h3 class="section">3.1 Fundamental
Structure</h3>
+<h3 class="section" id="Fundamental-Structure-1"><span>3.1 Fundamental
Structure<a class="copiable-link" href="#Fundamental-Structure-1">
¶</a></span></h3>
-<span id="index-ordinary-characters"></span>
-<span id="index-special-characters"></span>
-<p>In regular expressions, the characters
‘<samp>.?*+{|()[\^$</samp>’ are
-<em>special characters</em> and have uses described below. All other
-characters are <em>ordinary characters</em>, and each ordinary character
+<a class="index-entry-id" id="index-ordinary-characters"></a>
+<a class="index-entry-id" id="index-special-characters"></a>
+<p>In regular expressions, the characters ‘<samp
class="samp">.?*+{|()[\^$</samp>’ are
+<em class="dfn">special characters</em> and have uses described below. All
other
+characters are <em class="dfn">ordinary characters</em>, and each ordinary
character
is a regular expression that matches itself.
</p>
-<span id="index-_002e"></span>
-<span id="index-dot"></span>
-<span id="index-period"></span>
-<p>The period ‘<samp>.</samp>’ matches any single character.
-It is unspecified whether ‘<samp>.</samp>’ matches an encoding
error.
+<a class="index-entry-id" id="index-_002e"></a>
+<a class="index-entry-id" id="index-dot"></a>
+<a class="index-entry-id" id="index-period"></a>
+<p>The period ‘<samp class="samp">.</samp>’ matches any single
character.
+It is unspecified whether ‘<samp class="samp">.</samp>’ matches an
encoding error.
</p>
-<span id="index-interval-expressions"></span>
+<a class="index-entry-id" id="index-interval-expressions"></a>
<p>A regular expression may be followed by one of several
-repetition operators; the operators beginning with ‘<samp>{</samp>’
-are called <em>interval expressions</em>.
+repetition operators; the operators beginning with ‘<samp
class="samp">{</samp>’
+are called <em class="dfn">interval expressions</em>.
</p>
-<dl compact="compact">
-<dt id='index-_003f'><span>‘<samp>?</samp>’<a href='#index-_003f'
class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-question-mark"></span>
-<span id="index-match-expression-at-most-once"></span>
+<dl class="table">
+<dt>‘<samp class="samp">?</samp>’</dt>
+<dd><a class="index-entry-id" id="index-_003f"></a>
+<a class="index-entry-id" id="index-question-mark"></a>
+<a class="index-entry-id" id="index-match-expression-at-most-once"></a>
<p>The preceding item is optional and is matched at most once.
</p>
</dd>
-<dt id='index-_002a'><span>‘<samp>*</samp>’<a href='#index-_002a'
class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-asterisk"></span>
-<span id="index-match-expression-zero-or-more-times"></span>
+<dt>‘<samp class="samp">*</samp>’</dt>
+<dd><a class="index-entry-id" id="index-_002a"></a>
+<a class="index-entry-id" id="index-asterisk"></a>
+<a class="index-entry-id" id="index-match-expression-zero-or-more-times"></a>
<p>The preceding item is matched zero or more times.
</p>
</dd>
-<dt id='index-_002b'><span>‘<samp>+</samp>’<a href='#index-_002b'
class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-plus-sign"></span>
-<span id="index-match-expression-one-or-more-times"></span>
+<dt>‘<samp class="samp">+</samp>’</dt>
+<dd><a class="index-entry-id" id="index-_002b"></a>
+<a class="index-entry-id" id="index-plus-sign"></a>
+<a class="index-entry-id" id="index-match-expression-one-or-more-times"></a>
<p>The preceding item is matched one or more times.
</p>
</dd>
-<dt id='index-_007bn_007d'><span>‘<samp>{<var>n</var>}</samp>’<a
href='#index-_007bn_007d' class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-braces_002c-one-argument"></span>
-<span id="index-match-expression-n-times"></span>
-<p>The preceding item is matched exactly <var>n</var> times.
-</p>
-</dd>
-<dt
id='index-_007bn_002c_007d'><span>‘<samp>{<var>n</var>,}</samp>’<a
href='#index-_007bn_002c_007d' class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-braces_002c-second-argument-omitted"></span>
-<span id="index-match-expression-n-or-more-times"></span>
-<p>The preceding item is matched <var>n</var> or more times.
-</p>
-</dd>
-<dt
id='index-_007b_002cm_007d'><span>‘<samp>{,<var>m</var>}</samp>’<a
href='#index-_007b_002cm_007d' class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-braces_002c-first-argument-omitted"></span>
-<span id="index-match-expression-at-most-m-times"></span>
-<p>The preceding item is matched at most <var>m</var> times.
+<dt>‘<samp class="samp">{<var class="var">n</var>}</samp>’</dt>
+<dd><a class="index-entry-id" id="index-_007bn_007d"></a>
+<a class="index-entry-id" id="index-braces_002c-one-argument"></a>
+<a class="index-entry-id" id="index-match-expression-n-times"></a>
+<p>The preceding item is matched exactly <var class="var">n</var> times.
+</p>
+</dd>
+<dt>‘<samp class="samp">{<var class="var">n</var>,}</samp>’</dt>
+<dd><a class="index-entry-id" id="index-_007bn_002c_007d"></a>
+<a class="index-entry-id" id="index-braces_002c-second-argument-omitted"></a>
+<a class="index-entry-id" id="index-match-expression-n-or-more-times"></a>
+<p>The preceding item is matched <var class="var">n</var> or more times.
+</p>
+</dd>
+<dt>‘<samp class="samp">{,<var class="var">m</var>}</samp>’</dt>
+<dd><a class="index-entry-id" id="index-_007b_002cm_007d"></a>
+<a class="index-entry-id" id="index-braces_002c-first-argument-omitted"></a>
+<a class="index-entry-id" id="index-match-expression-at-most-m-times"></a>
+<p>The preceding item is matched at most <var class="var">m</var> times.
This is a GNU extension.
</p>
</dd>
-<dt
id='index-_007bn_002cm_007d'><span>‘<samp>{<var>n</var>,<var>m</var>}</samp>’<a
href='#index-_007bn_002cm_007d' class='copiable-anchor'> ¶</a></span></dt>
-<dd><span id="index-braces_002c-two-arguments"></span>
-<span id="index-match-expression-from-n-to-m-times"></span>
-<p>The preceding item is matched at least <var>n</var> times, but not more than
-<var>m</var> times.
+<dt>‘<samp class="samp">{<var class="var">n</var>,<var
class="var">m</var>}</samp>’</dt>
+<dd><a class="index-entry-id" id="index-_007bn_002cm_007d"></a>
+<a class="index-entry-id" id="index-braces_002c-two-arguments"></a>
+<a class="index-entry-id" id="index-match-expression-from-n-to-m-times"></a>
+<p>The preceding item is matched at least <var class="var">n</var> times, but
not more than
+<var class="var">m</var> times.
</p>
</dd>
</dl>
@@ -1388,89 +1480,93 @@
matches any string formed by concatenating two substrings
that respectively match the concatenated expressions.
</p>
-<span id="index-alternatives-in-regular-expressions"></span>
-<p>Two regular expressions may be joined by the infix operator
‘<samp>|</samp>’.
+<a class="index-entry-id" id="index-alternatives-in-regular-expressions"></a>
+<p>Two regular expressions may be joined by the infix operator ‘<samp
class="samp">|</samp>’.
The resulting regular expression matches any string matching either of
-the two expressions, which are called <em>alternatives</em>.
+the two expressions, which are called <em class="dfn">alternatives</em>.
</p>
<p>Repetition takes precedence over concatenation,
which in turn takes precedence over alternation.
A whole expression may be enclosed in parentheses
to override these precedence rules and form a subexpression.
-An unmatched ‘<samp>)</samp>’ matches just itself.
+An unmatched ‘<samp class="samp">)</samp>’ matches just itself.
</p>
<p>Not every character string is a valid regular expression.
-See <a href="#Problematic-Expressions">Problematic Regular Expressions</a>.
+See <a class="xref" href="#Problematic-Expressions">Problematic Regular
Expressions</a>.
</p>
<hr>
</div>
-<div class="section" id="Character-Classes-and-Bracket-Expressions">
-<div class="header">
+<div class="section-level-extent"
id="Character-Classes-and-Bracket-Expressions">
+<div class="nav-panel">
<p>
Next: <a href="#Special-Backslash-Expressions" accesskey="n"
rel="next">Special Backslash Expressions</a>, Previous: <a
href="#Fundamental-Structure" accesskey="p" rel="prev">Fundamental
Structure</a>, Up: <a href="#Regular-Expressions" accesskey="u"
rel="up">Regular Expressions</a> [<a href="#SEC_Contents" title="Table
of contents" rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Character-Classes-and-Bracket-Expressions-1"></span><h3
class="section">3.2 Character Classes and Bracket Expressions</h3>
+<h3 class="section" id="Character-Classes-and-Bracket-Expressions-1"><span>3.2
Character Classes and Bracket Expressions<a class="copiable-link"
href="#Character-Classes-and-Bracket-Expressions-1"> ¶</a></span></h3>
-<span id="index-bracket-expression"></span>
-<span id="index-character-class"></span>
-<p>A <em>bracket expression</em> is a list of characters enclosed by
‘<samp>[</samp>’ and
-‘<samp>]</samp>’.
+<a class="index-entry-id" id="index-bracket-expression"></a>
+<a class="index-entry-id" id="index-character-class"></a>
+<p>A <em class="dfn">bracket expression</em> is a list of characters enclosed
by ‘<samp class="samp">[</samp>’ and
+‘<samp class="samp">]</samp>’.
It matches any single character in that list.
-If the first character of the list is the caret ‘<samp>^</samp>’,
-then it matches any character <strong>not</strong> in the list,
+If the first character of the list is the caret ‘<samp
class="samp">^</samp>’,
+then it matches any character <strong class="strong">not</strong> in the list,
and it is unspecified whether it matches an encoding error.
For example, the regular expression
-‘<samp>[0123456789]</samp>’ matches any single digit,
-whereas ‘<samp>[^()]</samp>’ matches any single character that is
not
+‘<samp class="samp">[0123456789]</samp>’ matches any single digit,
+whereas ‘<samp class="samp">[^()]</samp>’ matches any single
character that is not
an opening or closing parenthesis, and might or might not match an
encoding error.
</p>
-<span id="index-range-expression"></span>
-<p>Within a bracket expression, a <em>range expression</em> consists of two
+<a class="index-entry-id" id="index-range-expression"></a>
+<p>Within a bracket expression, a <em class="dfn">range expression</em>
consists of two
characters separated by a hyphen.
It matches any single character that
sorts between the two characters, inclusive.
In the default C locale, the sorting sequence is the native character
-order; for example, ‘<samp>[a-d]</samp>’ is equivalent to
‘<samp>[abcd]</samp>’.
+order; for example, ‘<samp class="samp">[a-d]</samp>’ is
equivalent to ‘<samp class="samp">[abcd]</samp>’.
In other locales, the sorting sequence is not specified, and
-‘<samp>[a-d]</samp>’ might be equivalent to
‘<samp>[abcd]</samp>’ or to
-‘<samp>[aBbCcDd]</samp>’, or it might fail to match any character,
or the set of
+‘<samp class="samp">[a-d]</samp>’ might be equivalent to
‘<samp class="samp">[abcd]</samp>’ or to
+‘<samp class="samp">[aBbCcDd]</samp>’, or it might fail to match
any character, or the set of
characters that it matches might be erratic, or it might be invalid.
To obtain the traditional interpretation
-of bracket expressions, you can use the ‘<samp>C</samp>’ locale by
setting the
-<code>LC_ALL</code> environment variable to the value
‘<samp>C</samp>’.
+of bracket expressions, you can use the ‘<samp
class="samp">C</samp>’ locale by setting the
+<code class="env">LC_ALL</code> environment variable to the value ‘<samp
class="samp">C</samp>’.
</p>
<p>Finally, certain named classes of characters are predefined within
bracket expressions, as follows.
-Their interpretation depends on the <code>LC_CTYPE</code> locale;
-for example, ‘<samp>[[:alnum:]]</samp>’ means the character class
of numbers and letters
+Their interpretation depends on the <code class="env">LC_CTYPE</code> locale;
+for example, ‘<samp class="samp">[[:alnum:]]</samp>’ means the
character class of numbers and letters
in the current locale.
</p>
-<span id="index-classes-of-characters"></span>
-<span id="index-character-classes"></span>
-<dl compact="compact">
-<dt
id='index-alnum-character-class'><span>‘<samp>[:alnum:]</samp>’<a
href='#index-alnum-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-alphanumeric-characters"></span>
+<a class="index-entry-id" id="index-classes-of-characters"></a>
+<a class="index-entry-id" id="index-character-classes"></a>
+<dl class="table">
+<dt>‘<samp class="samp">[:alnum:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-alnum-character-class"></a>
+<a class="index-entry-id" id="index-alphanumeric-characters"></a>
<p>Alphanumeric characters:
-‘<samp>[:alpha:]</samp>’ and ‘<samp>[:digit:]</samp>’;
in the ‘<samp>C</samp>’ locale and ASCII
-character encoding, this is the same as ‘<samp>[0-9A-Za-z]</samp>’.
+‘<samp class="samp">[:alpha:]</samp>’ and ‘<samp
class="samp">[:digit:]</samp>’; in the ‘<samp
class="samp">C</samp>’ locale and ASCII
+character encoding, this is the same as ‘<samp
class="samp">[0-9A-Za-z]</samp>’.
</p>
</dd>
-<dt
id='index-alpha-character-class'><span>‘<samp>[:alpha:]</samp>’<a
href='#index-alpha-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-alphabetic-characters"></span>
+<dt>‘<samp class="samp">[:alpha:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-alpha-character-class"></a>
+<a class="index-entry-id" id="index-alphabetic-characters"></a>
<p>Alphabetic characters:
-‘<samp>[:lower:]</samp>’ and ‘<samp>[:upper:]</samp>’;
in the ‘<samp>C</samp>’ locale and ASCII
-character encoding, this is the same as ‘<samp>[A-Za-z]</samp>’.
+‘<samp class="samp">[:lower:]</samp>’ and ‘<samp
class="samp">[:upper:]</samp>’; in the ‘<samp
class="samp">C</samp>’ locale and ASCII
+character encoding, this is the same as ‘<samp
class="samp">[A-Za-z]</samp>’.
</p>
</dd>
-<dt
id='index-blank-character-class'><span>‘<samp>[:blank:]</samp>’<a
href='#index-blank-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-blank-characters"></span>
+<dt>‘<samp class="samp">[:blank:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-blank-character-class"></a>
+<a class="index-entry-id" id="index-blank-characters"></a>
<p>Blank characters:
space and tab.
</p>
</dd>
-<dt
id='index-cntrl-character-class'><span>‘<samp>[:cntrl:]</samp>’<a
href='#index-cntrl-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-control-characters"></span>
+<dt>‘<samp class="samp">[:cntrl:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-cntrl-character-class"></a>
+<a class="index-entry-id" id="index-control-characters"></a>
<p>Control characters.
In ASCII, these characters have octal codes 000
through 037, and 177 (DEL).
@@ -1478,58 +1574,66 @@
the equivalent characters, if any.
</p>
</dd>
-<dt
id='index-digit-character-class'><span>‘<samp>[:digit:]</samp>’<a
href='#index-digit-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-digit-characters"></span>
-<span id="index-numeric-characters"></span>
-<p>Digits: <code>0 1 2 3 4 5 6 7 8 9</code>.
+<dt>‘<samp class="samp">[:digit:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-digit-character-class"></a>
+<a class="index-entry-id" id="index-digit-characters"></a>
+<a class="index-entry-id" id="index-numeric-characters"></a>
+<p>Digits: <code class="code">0 1 2 3 4 5 6 7 8 9</code>.
</p>
</dd>
-<dt
id='index-graph-character-class'><span>‘<samp>[:graph:]</samp>’<a
href='#index-graph-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-graphic-characters"></span>
+<dt>‘<samp class="samp">[:graph:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-graph-character-class"></a>
+<a class="index-entry-id" id="index-graphic-characters"></a>
<p>Graphical characters:
-‘<samp>[:alnum:]</samp>’ and ‘<samp>[:punct:]</samp>’.
+‘<samp class="samp">[:alnum:]</samp>’ and ‘<samp
class="samp">[:punct:]</samp>’.
</p>
</dd>
-<dt
id='index-lower-character-class'><span>‘<samp>[:lower:]</samp>’<a
href='#index-lower-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-lower_002dcase-letters"></span>
-<p>Lower-case letters; in the ‘<samp>C</samp>’ locale and ASCII
character
+<dt>‘<samp class="samp">[:lower:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-lower-character-class"></a>
+<a class="index-entry-id" id="index-lower_002dcase-letters"></a>
+<p>Lower-case letters; in the ‘<samp class="samp">C</samp>’ locale
and ASCII character
encoding, this is
-<code>a b c d e f g h i j k l m n o p q r s t u v w x y z</code>.
+<code class="code">a b c d e f g h i j k l m n o p q r s t u v w x y z</code>.
</p>
</dd>
-<dt
id='index-print-character-class'><span>‘<samp>[:print:]</samp>’<a
href='#index-print-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-printable-characters"></span>
+<dt>‘<samp class="samp">[:print:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-print-character-class"></a>
+<a class="index-entry-id" id="index-printable-characters"></a>
<p>Printable characters:
-‘<samp>[:alnum:]</samp>’, ‘<samp>[:punct:]</samp>’,
and space.
+‘<samp class="samp">[:alnum:]</samp>’, ‘<samp
class="samp">[:punct:]</samp>’, and space.
</p>
</dd>
-<dt
id='index-punct-character-class'><span>‘<samp>[:punct:]</samp>’<a
href='#index-punct-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-punctuation-characters"></span>
-<p>Punctuation characters; in the ‘<samp>C</samp>’ locale and
ASCII character
+<dt>‘<samp class="samp">[:punct:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-punct-character-class"></a>
+<a class="index-entry-id" id="index-punctuation-characters"></a>
+<p>Punctuation characters; in the ‘<samp class="samp">C</samp>’
locale and ASCII character
encoding, this is
-<code>! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` {
| } ~</code>.
+<code class="code">! " # $ % & ' ( ) * + , - . / : ; < = > ? @
[ \ ] ^ _ ` { | } ~</code>.
</p>
</dd>
-<dt
id='index-space-character-class'><span>‘<samp>[:space:]</samp>’<a
href='#index-space-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-space-characters"></span>
-<span id="index-whitespace-characters"></span>
-<p>Space characters: in the ‘<samp>C</samp>’ locale, this is
+<dt>‘<samp class="samp">[:space:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-space-character-class"></a>
+<a class="index-entry-id" id="index-space-characters"></a>
+<a class="index-entry-id" id="index-whitespace-characters"></a>
+<p>Space characters: in the ‘<samp class="samp">C</samp>’ locale,
this is
tab, newline, vertical tab, form feed, carriage return, and space.
-See <a href="#Usage">Usage</a>, for more discussion of matching newlines.
+See <a class="xref" href="#Usage">Usage</a>, for more discussion of matching
newlines.
</p>
</dd>
-<dt
id='index-upper-character-class'><span>‘<samp>[:upper:]</samp>’<a
href='#index-upper-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-upper_002dcase-letters"></span>
-<p>Upper-case letters: in the ‘<samp>C</samp>’ locale and ASCII
character
+<dt>‘<samp class="samp">[:upper:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-upper-character-class"></a>
+<a class="index-entry-id" id="index-upper_002dcase-letters"></a>
+<p>Upper-case letters: in the ‘<samp class="samp">C</samp>’ locale
and ASCII character
encoding, this is
-<code>A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</code>.
+<code class="code">A B C D E F G H I J K L M N O P Q R S T U V W X Y Z</code>.
</p>
</dd>
-<dt
id='index-xdigit-character-class'><span>‘<samp>[:xdigit:]</samp>’<a
href='#index-xdigit-character-class' class='copiable-anchor'>
¶</a></span></dt>
-<dd><span id="index-xdigit-class"></span>
-<span id="index-hexadecimal-digits"></span>
+<dt>‘<samp class="samp">[:xdigit:]</samp>’</dt>
+<dd><a class="index-entry-id" id="index-xdigit-character-class"></a>
+<a class="index-entry-id" id="index-xdigit-class"></a>
+<a class="index-entry-id" id="index-hexadecimal-digits"></a>
<p>Hexadecimal digits:
-<code>0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f</code>.
+<code class="code">0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f</code>.
</p>
</dd>
</dl>
@@ -1537,53 +1641,53 @@
part of the symbolic names, and must be included in addition to
the brackets delimiting the bracket expression.
</p>
-<p>If you mistakenly omit the outer brackets, and search for say,
‘<samp>[:upper:]</samp>’,
-GNU <code>grep</code> prints a diagnostic and exits with status 2, on
+<p>If you mistakenly omit the outer brackets, and search for say, ‘<samp
class="samp">[:upper:]</samp>’,
+GNU <code class="command">grep</code> prints a diagnostic and exits with
status 2, on
the assumption that you did not intend to search for the
-regular expression ‘<samp>[:epru]</samp>’.
+regular expression ‘<samp class="samp">[:epru]</samp>’.
</p>
<p>Special characters lose their special meaning inside bracket expressions.
</p>
-<dl compact="compact">
-<dt><span>‘<samp>]</samp>’</span></dt>
+<dl class="table">
+<dt>‘<samp class="samp">]</samp>’</dt>
<dd><p>ends the bracket expression if it’s not the first list item.
-So, if you want to make the ‘<samp>]</samp>’ character a list item,
+So, if you want to make the ‘<samp class="samp">]</samp>’
character a list item,
you must put it first.
</p>
</dd>
-<dt><span>‘<samp>[.</samp>’</span></dt>
+<dt>‘<samp class="samp">[.</samp>’</dt>
<dd><p>represents the open collating symbol.
</p>
</dd>
-<dt><span>‘<samp>.]</samp>’</span></dt>
+<dt>‘<samp class="samp">.]</samp>’</dt>
<dd><p>represents the close collating symbol.
</p>
</dd>
-<dt><span>‘<samp>[=</samp>’</span></dt>
+<dt>‘<samp class="samp">[=</samp>’</dt>
<dd><p>represents the open equivalence class.
</p>
</dd>
-<dt><span>‘<samp>=]</samp>’</span></dt>
+<dt>‘<samp class="samp">=]</samp>’</dt>
<dd><p>represents the close equivalence class.
</p>
</dd>
-<dt><span>‘<samp>[:</samp>’</span></dt>
+<dt>‘<samp class="samp">[:</samp>’</dt>
<dd><p>represents the open character class symbol, and should be followed by a
valid character class name.
</p>
</dd>
-<dt><span>‘<samp>:]</samp>’</span></dt>
+<dt>‘<samp class="samp">:]</samp>’</dt>
<dd><p>represents the close character class symbol.
</p>
</dd>
-<dt><span>‘<samp>-</samp>’</span></dt>
+<dt>‘<samp class="samp">-</samp>’</dt>
<dd><p>represents the range if it’s not first or last in a list or the
ending point
-of a range. To make the ‘<samp>-</samp>’ a list item, it is best
to put it last.
+of a range. To make the ‘<samp class="samp">-</samp>’ a list
item, it is best to put it last.
</p>
</dd>
-<dt><span>‘<samp>^</samp>’</span></dt>
+<dt>‘<samp class="samp">^</samp>’</dt>
<dd><p>represents the characters not in the list.
-If you want to make the ‘<samp>^</samp>’
+If you want to make the ‘<samp class="samp">^</samp>’
character a list item, place it anywhere but first.
</p>
</dd>
@@ -1591,309 +1695,309 @@
<hr>
</div>
-<div class="section" id="Special-Backslash-Expressions">
-<div class="header">
+<div class="section-level-extent" id="Special-Backslash-Expressions">
+<div class="nav-panel">
<p>
Next: <a href="#Anchoring" accesskey="n" rel="next">Anchoring</a>, Previous:
<a href="#Character-Classes-and-Bracket-Expressions" accesskey="p"
rel="prev">Character Classes and Bracket Expressions</a>, Up: <a
href="#Regular-Expressions" accesskey="u" rel="up">Regular Expressions</a>
[<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Special-Backslash-Expressions-1"></span><h3 class="section">3.3
Special Backslash Expressions</h3>
-<span id="index-backslash"></span>
+<h3 class="section" id="Special-Backslash-Expressions-1"><span>3.3 Special
Backslash Expressions<a class="copiable-link"
href="#Special-Backslash-Expressions-1"> ¶</a></span></h3>
+<a class="index-entry-id" id="index-backslash"></a>
-<p>The ‘<samp>\</samp>’ character followed by a special character
is a regular
+<p>The ‘<samp class="samp">\</samp>’ character followed by a
special character is a regular
expression that matches the special character.
-The ‘<samp>\</samp>’ character,
+The ‘<samp class="samp">\</samp>’ character,
when followed by certain ordinary characters,
takes a special meaning:
</p>
-<dl compact="compact">
-<dt><span>‘<samp>\b</samp>’</span></dt>
+<dl class="table">
+<dt>‘<samp class="samp">\b</samp>’</dt>
<dd><p>Match the empty string at the edge of a word.
</p>
</dd>
-<dt><span>‘<samp>\B</samp>’</span></dt>
+<dt>‘<samp class="samp">\B</samp>’</dt>
<dd><p>Match the empty string provided it’s not at the edge of a word.
</p>
</dd>
-<dt><span>‘<samp>\<</samp>’</span></dt>
+<dt>‘<samp class="samp">\<</samp>’</dt>
<dd><p>Match the empty string at the beginning of a word.
</p>
</dd>
-<dt><span>‘<samp>\></samp>’</span></dt>
+<dt>‘<samp class="samp">\></samp>’</dt>
<dd><p>Match the empty string at the end of a word.
</p>
</dd>
-<dt><span>‘<samp>\w</samp>’</span></dt>
-<dd><p>Match word constituent, it is a synonym for
‘<samp>[_[:alnum:]]</samp>’.
+<dt>‘<samp class="samp">\w</samp>’</dt>
+<dd><p>Match word constituent, it is a synonym for ‘<samp
class="samp">[_[:alnum:]]</samp>’.
</p>
</dd>
-<dt><span>‘<samp>\W</samp>’</span></dt>
-<dd><p>Match non-word constituent, it is a synonym for
‘<samp>[^_[:alnum:]]</samp>’.
+<dt>‘<samp class="samp">\W</samp>’</dt>
+<dd><p>Match non-word constituent, it is a synonym for ‘<samp
class="samp">[^_[:alnum:]]</samp>’.
</p>
</dd>
-<dt><span>‘<samp>\s</samp>’</span></dt>
-<dd><p>Match whitespace, it is a synonym for
‘<samp>[[:space:]]</samp>’.
+<dt>‘<samp class="samp">\s</samp>’</dt>
+<dd><p>Match whitespace, it is a synonym for ‘<samp
class="samp">[[:space:]]</samp>’.
</p>
</dd>
-<dt><span>‘<samp>\S</samp>’</span></dt>
-<dd><p>Match non-whitespace, it is a synonym for
‘<samp>[^[:space:]]</samp>’.
+<dt>‘<samp class="samp">\S</samp>’</dt>
+<dd><p>Match non-whitespace, it is a synonym for ‘<samp
class="samp">[^[:space:]]</samp>’.
</p>
</dd>
-<dt><span>‘<samp>\]</samp>’</span></dt>
-<dd><p>Match ‘<samp>]</samp>’.
+<dt>‘<samp class="samp">\]</samp>’</dt>
+<dd><p>Match ‘<samp class="samp">]</samp>’.
</p>
</dd>
-<dt><span>‘<samp>\}</samp>’</span></dt>
-<dd><p>Match ‘<samp>}</samp>’.
+<dt>‘<samp class="samp">\}</samp>’</dt>
+<dd><p>Match ‘<samp class="samp">}</samp>’.
</p>
</dd>
</dl>
-<p>For example, ‘<samp>\brat\b</samp>’ matches the separate word
‘<samp>rat</samp>’,
-‘<samp>\Brat\B</samp>’ matches ‘<samp>crate</samp>’
but not ‘<samp>furry rat</samp>’.
+<p>For example, ‘<samp class="samp">\brat\b</samp>’ matches the
separate word ‘<samp class="samp">rat</samp>’,
+‘<samp class="samp">\Brat\B</samp>’ matches ‘<samp
class="samp">crate</samp>’ but not ‘<samp class="samp">furry
rat</samp>’.
</p>
-<p>The behavior of <code>grep</code> is unspecified if a unescaped backslash
+<p>The behavior of <code class="command">grep</code> is unspecified if a
unescaped backslash
is not followed by a special character, a nonzero digit, or a
-character in the above list. Although <code>grep</code> might issue a
+character in the above list. Although <code class="command">grep</code> might
issue a
diagnostic and/or give the backslash an interpretation now, its
behavior may change if the syntax of regular expressions is extended
in future versions.
</p>
<hr>
</div>
-<div class="section" id="Anchoring">
-<div class="header">
+<div class="section-level-extent" id="Anchoring">
+<div class="nav-panel">
<p>
Next: <a href="#Back_002dreferences-and-Subexpressions" accesskey="n"
rel="next">Back-references and Subexpressions</a>, Previous: <a
href="#Special-Backslash-Expressions" accesskey="p" rel="prev">Special
Backslash Expressions</a>, Up: <a href="#Regular-Expressions" accesskey="u"
rel="up">Regular Expressions</a> [<a href="#SEC_Contents" title="Table
of contents" rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Anchoring-1"></span><h3 class="section">3.4 Anchoring</h3>
-<span id="index-anchoring"></span>
+<h3 class="section" id="Anchoring-1"><span>3.4 Anchoring<a
class="copiable-link" href="#Anchoring-1"> ¶</a></span></h3>
+<a class="index-entry-id" id="index-anchoring"></a>
-<p>The caret ‘<samp>^</samp>’ and the dollar sign
‘<samp>$</samp>’ are special characters that
+<p>The caret ‘<samp class="samp">^</samp>’ and the dollar sign
‘<samp class="samp">$</samp>’ are special characters that
respectively match the empty string at the beginning and end of a line.
-They are termed <em>anchors</em>, since they force the match to be
“anchored”
+They are termed <em class="dfn">anchors</em>, since they force the match to be
“anchored”
to beginning or end of a line, respectively.
</p>
<hr>
</div>
-<div class="section" id="Back_002dreferences-and-Subexpressions">
-<div class="header">
+<div class="section-level-extent" id="Back_002dreferences-and-Subexpressions">
+<div class="nav-panel">
<p>
Next: <a href="#Basic-vs-Extended" accesskey="n" rel="next">Basic vs Extended
Regular Expressions</a>, Previous: <a href="#Anchoring" accesskey="p"
rel="prev">Anchoring</a>, Up: <a href="#Regular-Expressions" accesskey="u"
rel="up">Regular Expressions</a> [<a href="#SEC_Contents" title="Table
of contents" rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Back_002dreferences-and-Subexpressions-1"></span><h3
class="section">3.5 Back-references and Subexpressions</h3>
-<span id="index-subexpression"></span>
-<span id="index-back_002dreference"></span>
-
-<p>The back-reference ‘<samp>\<var>n</var></samp>’,
-where <var>n</var> is a single nonzero digit, matches
-the substring previously matched by the <var>n</var>th parenthesized
subexpression
+<h3 class="section" id="Back_002dreferences-and-Subexpressions-1"><span>3.5
Back-references and Subexpressions<a class="copiable-link"
href="#Back_002dreferences-and-Subexpressions-1"> ¶</a></span></h3>
+<a class="index-entry-id" id="index-subexpression"></a>
+<a class="index-entry-id" id="index-back_002dreference"></a>
+
+<p>The back-reference ‘<samp class="samp">\<var
class="var">n</var></samp>’,
+where <var class="var">n</var> is a single nonzero digit, matches
+the substring previously matched by the <var class="var">n</var>th
parenthesized subexpression
of the regular expression.
-For example, ‘<samp>(a)\1</samp>’ matches
‘<samp>aa</samp>’.
+For example, ‘<samp class="samp">(a)\1</samp>’ matches
‘<samp class="samp">aa</samp>’.
If the parenthesized subexpression does not participate in the match,
the back-reference makes the whole match fail;
-for example, ‘<samp>(a)*\1</samp>’ fails to match
‘<samp>a</samp>’.
+for example, ‘<samp class="samp">(a)*\1</samp>’ fails to match
‘<samp class="samp">a</samp>’.
If the parenthesized subexpression matches more than one substring,
the back-reference refers to the last matched substring;
-for example, ‘<samp>^(ab*)*\1$</samp>’ matches
‘<samp>ababbabb</samp>’ but not ‘<samp>ababbab</samp>’.
+for example, ‘<samp class="samp">^(ab*)*\1$</samp>’ matches
‘<samp class="samp">ababbabb</samp>’ but not ‘<samp
class="samp">ababbab</samp>’.
When multiple regular expressions are given with
-<samp>-e</samp> or from a file (‘<samp>-f <var>file</var></samp>’),
+<samp class="option">-e</samp> or from a file (‘<samp class="samp">-f
<var class="var">file</var></samp>’),
back-references are local to each expression.
</p>
-<p>See <a href="#Known-Bugs">Known Bugs</a>, for some known problems with
back-references.
+<p>See <a class="xref" href="#Known-Bugs">Known Bugs</a>, for some known
problems with back-references.
</p>
<hr>
</div>
-<div class="section" id="Basic-vs-Extended">
-<div class="header">
+<div class="section-level-extent" id="Basic-vs-Extended">
+<div class="nav-panel">
<p>
Next: <a href="#Problematic-Expressions" accesskey="n" rel="next">Problematic
Regular Expressions</a>, Previous: <a
href="#Back_002dreferences-and-Subexpressions" accesskey="p"
rel="prev">Back-references and Subexpressions</a>, Up: <a
href="#Regular-Expressions" accesskey="u" rel="up">Regular Expressions</a>
[<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Basic-vs-Extended-Regular-Expressions"></span><h3
class="section">3.6 Basic vs Extended Regular Expressions</h3>
-<span id="index-basic-regular-expressions"></span>
+<h3 class="section" id="Basic-vs-Extended-Regular-Expressions"><span>3.6 Basic
vs Extended Regular Expressions<a class="copiable-link"
href="#Basic-vs-Extended-Regular-Expressions"> ¶</a></span></h3>
+<a class="index-entry-id" id="index-basic-regular-expressions"></a>
<p>Basic regular expressions differ from extended regular expressions
in the following ways:
</p>
-<ul>
-<li> The characters ‘<samp>?</samp>’, ‘<samp>+</samp>’,
-‘<samp>{</samp>’, ‘<samp>|</samp>’,
‘<samp>(</samp>’, and ‘<samp>)</samp>’ lose their
special meaning;
-instead use the backslashed versions ‘<samp>\?</samp>’,
‘<samp>\+</samp>’, ‘<samp>\{</samp>’,
-‘<samp>\|</samp>’, ‘<samp>\(</samp>’, and
‘<samp>\)</samp>’. Also, a backslash is needed
-before an interval expression’s closing ‘<samp>}</samp>’.
+<ul class="itemize mark-bullet">
+<li>The characters ‘<samp class="samp">?</samp>’, ‘<samp
class="samp">+</samp>’,
+‘<samp class="samp">{</samp>’, ‘<samp
class="samp">|</samp>’, ‘<samp class="samp">(</samp>’, and
‘<samp class="samp">)</samp>’ lose their special meaning;
+instead use the backslashed versions ‘<samp
class="samp">\?</samp>’, ‘<samp class="samp">\+</samp>’,
‘<samp class="samp">\{</samp>’,
+‘<samp class="samp">\|</samp>’, ‘<samp
class="samp">\(</samp>’, and ‘<samp class="samp">\)</samp>’.
Also, a backslash is needed
+before an interval expression’s closing ‘<samp
class="samp">}</samp>’.
-</li><li> An unmatched ‘<samp>\)</samp>’ is invalid.
+</li><li>An unmatched ‘<samp class="samp">\)</samp>’ is invalid.
-</li><li> If an unescaped ‘<samp>^</samp>’ appears neither first,
nor directly after
-‘<samp>\(</samp>’ or ‘<samp>\|</samp>’, it is treated
like an ordinary character and
+</li><li>If an unescaped ‘<samp class="samp">^</samp>’ appears
neither first, nor directly after
+‘<samp class="samp">\(</samp>’ or ‘<samp
class="samp">\|</samp>’, it is treated like an ordinary character and
is not an anchor.
-</li><li> If an unescaped ‘<samp>$</samp>’ appears neither last,
nor directly before
-‘<samp>\|</samp>’ or ‘<samp>\)</samp>’, it is treated
like an ordinary character and
+</li><li>If an unescaped ‘<samp class="samp">$</samp>’ appears
neither last, nor directly before
+‘<samp class="samp">\|</samp>’ or ‘<samp
class="samp">\)</samp>’, it is treated like an ordinary character and
is not an anchor.
-</li><li> If an unescaped ‘<samp>*</samp>’ appears first, or
appears directly after
-‘<samp>\(</samp>’ or ‘<samp>\|</samp>’ or anchoring
‘<samp>^</samp>’, it is treated like an
+</li><li>If an unescaped ‘<samp class="samp">*</samp>’ appears
first, or appears directly after
+‘<samp class="samp">\(</samp>’ or ‘<samp
class="samp">\|</samp>’ or anchoring ‘<samp
class="samp">^</samp>’, it is treated like an
ordinary character and is not a repetition operator.
</li></ul>
<hr>
</div>
-<div class="section" id="Problematic-Expressions">
-<div class="header">
+<div class="section-level-extent" id="Problematic-Expressions">
+<div class="nav-panel">
<p>
Next: <a href="#Character-Encoding" accesskey="n" rel="next">Character
Encoding</a>, Previous: <a href="#Basic-vs-Extended" accesskey="p"
rel="prev">Basic vs Extended Regular Expressions</a>, Up: <a
href="#Regular-Expressions" accesskey="u" rel="up">Regular Expressions</a>
[<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Problematic-Regular-Expressions"></span><h3 class="section">3.7
Problematic Regular Expressions</h3>
+<h3 class="section" id="Problematic-Regular-Expressions"><span>3.7 Problematic
Regular Expressions<a class="copiable-link"
href="#Problematic-Regular-Expressions"> ¶</a></span></h3>
-<span id="index-invalid-regular-expressions"></span>
-<span id="index-unspecified-behavior-in-regular-expressions"></span>
-<p>Some strings are <em>invalid regular expressions</em> and cause
-<code>grep</code> to issue a diagnostic and fail. For example,
‘<samp>xy\1</samp>’
+<a class="index-entry-id" id="index-invalid-regular-expressions"></a>
+<a class="index-entry-id"
id="index-unspecified-behavior-in-regular-expressions"></a>
+<p>Some strings are <em class="dfn">invalid regular expressions</em> and cause
+<code class="command">grep</code> to issue a diagnostic and fail. For
example, ‘<samp class="samp">xy\1</samp>’
is invalid because there is no parenthesized subexpression for the
-back-reference ‘<samp>\1</samp>’ to refer to.
+back-reference ‘<samp class="samp">\1</samp>’ to refer to.
</p>
-<p>Also, some regular expressions have <em>unspecified behavior</em> and
-should be avoided even if <code>grep</code> does not currently diagnose
-them. For example, ‘<samp>xy\0</samp>’ has unspecified behavior
because
-‘<samp>0</samp>’ is not a special character and
‘<samp>\0</samp>’ is not a special
-backslash expression (see <a href="#Special-Backslash-Expressions">Special
Backslash Expressions</a>).
+<p>Also, some regular expressions have <em class="dfn">unspecified
behavior</em> and
+should be avoided even if <code class="command">grep</code> does not currently
diagnose
+them. For example, ‘<samp class="samp">xy\0</samp>’ has
unspecified behavior because
+‘<samp class="samp">0</samp>’ is not a special character and
‘<samp class="samp">\0</samp>’ is not a special
+backslash expression (see <a class="pxref"
href="#Special-Backslash-Expressions">Special Backslash Expressions</a>).
Unspecified behavior can be particularly problematic because the set
of matched strings might be only partially specified, or not be
specified at all, or the expression might even be invalid.
</p>
<p>The following regular expression constructs are invalid on all
platforms conforming to POSIX, so portable scripts can assume that
-<code>grep</code> rejects these constructs:
+<code class="command">grep</code> rejects these constructs:
</p>
-<ul>
-<li> A basic regular expression containing a back-reference
‘<samp>\<var>n</var></samp>’
-preceded by fewer than <var>n</var> closing parentheses. For example,
-‘<samp>\(a\)\2</samp>’ is invalid.
-
-</li><li> A bracket expression containing ‘<samp>[:</samp>’ that
does not start a
-character class; and similarly for ‘<samp>[=</samp>’ and
‘<samp>[.</samp>’. For
-example, ‘<samp>[a[:b]</samp>’ and
‘<samp>[a[:ouch:]b]</samp>’ are invalid.
+<ul class="itemize mark-bullet">
+<li>A basic regular expression containing a back-reference ‘<samp
class="samp">\<var class="var">n</var></samp>’
+preceded by fewer than <var class="var">n</var> closing parentheses. For
example,
+‘<samp class="samp">\(a\)\2</samp>’ is invalid.
+
+</li><li>A bracket expression containing ‘<samp
class="samp">[:</samp>’ that does not start a
+character class; and similarly for ‘<samp class="samp">[=</samp>’
and ‘<samp class="samp">[.</samp>’. For
+example, ‘<samp class="samp">[a[:b]</samp>’ and ‘<samp
class="samp">[a[:ouch:]b]</samp>’ are invalid.
</li></ul>
-<p>GNU <code>grep</code> treats the following constructs as invalid.
-However, other <code>grep</code> implementations might allow them, so
+<p>GNU <code class="command">grep</code> treats the following constructs as
invalid.
+However, other <code class="command">grep</code> implementations might allow
them, so
portable scripts should not rely on their being invalid:
</p>
-<ul>
-<li> Unescaped ‘<samp>\</samp>’ at the end of a regular expression.
+<ul class="itemize mark-bullet">
+<li>Unescaped ‘<samp class="samp">\</samp>’ at the end of a
regular expression.
-</li><li> Unescaped ‘<samp>[</samp>’ that does not start a bracket
expression.
+</li><li>Unescaped ‘<samp class="samp">[</samp>’ that does not
start a bracket expression.
-</li><li> A ‘<samp>\{</samp>’ in a basic regular expression that
does not start an
+</li><li>A ‘<samp class="samp">\{</samp>’ in a basic regular
expression that does not start an
interval expression.
-</li><li> A basic regular expression with unbalanced
‘<samp>\(</samp>’ or ‘<samp>\)</samp>’,
-or an extended regular expression with unbalanced ‘<samp>(</samp>’.
+</li><li>A basic regular expression with unbalanced ‘<samp
class="samp">\(</samp>’ or ‘<samp class="samp">\)</samp>’,
+or an extended regular expression with unbalanced ‘<samp
class="samp">(</samp>’.
-</li><li> In the POSIX locale, a range expression like
‘<samp>z-a</samp>’ that
-represents zero elements. A non-GNU <code>grep</code> might treat it as
+</li><li>In the POSIX locale, a range expression like ‘<samp
class="samp">z-a</samp>’ that
+represents zero elements. A non-GNU <code class="command">grep</code> might
treat it as
a valid range that never matches.
-</li><li> An interval expression with a repetition count greater than 32767.
+</li><li>An interval expression with a repetition count greater than 32767.
(The portable POSIX limit is 255, and even interval expressions with
smaller counts can be impractically slow on all known implementations.)
-</li><li> A bracket expression that contains at least three elements, the first
-and last of which are both ‘<samp>:</samp>’, or both
‘<samp>.</samp>’, or both
-‘<samp>=</samp>’. For example, a non-GNU <code>grep</code> might
treat
-‘<samp>[:alpha:]</samp>’ like
‘<samp>[[:alpha:]]</samp>’, or like
‘<samp>[:ahlp]</samp>’.
+</li><li>A bracket expression that contains at least three elements, the first
+and last of which are both ‘<samp class="samp">:</samp>’, or both
‘<samp class="samp">.</samp>’, or both
+‘<samp class="samp">=</samp>’. For example, a non-GNU <code
class="command">grep</code> might treat
+‘<samp class="samp">[:alpha:]</samp>’ like ‘<samp
class="samp">[[:alpha:]]</samp>’, or like ‘<samp
class="samp">[:ahlp]</samp>’.
</li></ul>
<p>The following constructs have well-defined behavior in GNU
-<code>grep</code>. However, they have unspecified behavior elsewhere, so
+<code class="command">grep</code>. However, they have unspecified behavior
elsewhere, so
portable scripts should avoid them:
</p>
-<ul>
-<li> Special backslash expressions like ‘<samp>\b</samp>’,
‘<samp>\<</samp>’, and ‘<samp>\]</samp>’.
-See <a href="#Special-Backslash-Expressions">Special Backslash Expressions</a>.
+<ul class="itemize mark-bullet">
+<li>Special backslash expressions like ‘<samp
class="samp">\b</samp>’, ‘<samp class="samp">\<</samp>’,
and ‘<samp class="samp">\]</samp>’.
+See <a class="xref" href="#Special-Backslash-Expressions">Special Backslash
Expressions</a>.
-</li><li> A basic regular expression that uses ‘<samp>\?</samp>’,
‘<samp>\+</samp>’, or ‘<samp>\|</samp>’.
+</li><li>A basic regular expression that uses ‘<samp
class="samp">\?</samp>’, ‘<samp class="samp">\+</samp>’, or
‘<samp class="samp">\|</samp>’.
-</li><li> An extended regular expression that uses back-references.
+</li><li>An extended regular expression that uses back-references.
-</li><li> An empty regular expression, subexpression, or alternative. For
-example, ‘<samp>(a|bc|)</samp>’ is not portable; a portable
equivalent is
-‘<samp>(a|bc)?</samp>’.
+</li><li>An empty regular expression, subexpression, or alternative. For
+example, ‘<samp class="samp">(a|bc|)</samp>’ is not portable; a
portable equivalent is
+‘<samp class="samp">(a|bc)?</samp>’.
-</li><li> In a basic regular expression, an anchoring
‘<samp>^</samp>’ that appears
-directly after ‘<samp>\(</samp>’, or an anchoring
‘<samp>$</samp>’ that appears
-directly before ‘<samp>\)</samp>’.
+</li><li>In a basic regular expression, an anchoring ‘<samp
class="samp">^</samp>’ that appears
+directly after ‘<samp class="samp">\(</samp>’, or an anchoring
‘<samp class="samp">$</samp>’ that appears
+directly before ‘<samp class="samp">\)</samp>’.
-</li><li> In a basic regular expression, a repetition operator that
+</li><li>In a basic regular expression, a repetition operator that
directly follows another repetition operator.
-</li><li> In an extended regular expression, unescaped
‘<samp>{</samp>’
+</li><li>In an extended regular expression, unescaped ‘<samp
class="samp">{</samp>’
that does not begin a valid interval expression.
-GNU <code>grep</code> treats the ‘<samp>{</samp>’ as an ordinary
character.
+GNU <code class="command">grep</code> treats the ‘<samp
class="samp">{</samp>’ as an ordinary character.
-</li><li> A null character or an encoding error in either pattern or input
data.
-See <a href="#Character-Encoding">Character Encoding</a>.
+</li><li>A null character or an encoding error in either pattern or input data.
+See <a class="xref" href="#Character-Encoding">Character Encoding</a>.
-</li><li> An input file that ends in a non-newline character,
-where GNU <code>grep</code> silently supplies a newline.
+</li><li>An input file that ends in a non-newline character,
+where GNU <code class="command">grep</code> silently supplies a newline.
</li></ul>
<p>The following constructs have unspecified behavior, in both GNU
-and other <code>grep</code> implementations. Scripts should avoid
+and other <code class="command">grep</code> implementations. Scripts should
avoid
them whenever possible.
</p>
-<ul>
-<li> A backslash escaping an ordinary character, unless it is a
-back-reference like ‘<samp>\1</samp>’ or a special backslash
expression like
-‘<samp>\<</samp>’ or ‘<samp>\b</samp>’. See <a
href="#Special-Backslash-Expressions">Special Backslash Expressions</a>. For
-example, ‘<samp>\x</samp>’ has unspecified behavior now, and a
future version
-of <code>grep</code> might specify ‘<samp>\x</samp>’ to have a new
behavior.
+<ul class="itemize mark-bullet">
+<li>A backslash escaping an ordinary character, unless it is a
+back-reference like ‘<samp class="samp">\1</samp>’ or a special
backslash expression like
+‘<samp class="samp">\<</samp>’ or ‘<samp
class="samp">\b</samp>’. See <a class="xref"
href="#Special-Backslash-Expressions">Special Backslash Expressions</a>. For
+example, ‘<samp class="samp">\x</samp>’ has unspecified behavior
now, and a future version
+of <code class="command">grep</code> might specify ‘<samp
class="samp">\x</samp>’ to have a new behavior.
-</li><li> A repetition operator that appears directly after an anchor, or at
the
+</li><li>A repetition operator that appears directly after an anchor, or at the
start of a complete regular expression, parenthesized subexpression,
-or alternative. For example, ‘<samp>+|^*(+a|?-b)</samp>’ has
unspecified
-behavior, whereas ‘<samp>\+|^\*(\+a|\?-b)</samp>’ is portable.
+or alternative. For example, ‘<samp
class="samp">+|^*(+a|?-b)</samp>’ has unspecified
+behavior, whereas ‘<samp class="samp">\+|^\*(\+a|\?-b)</samp>’ is
portable.
-</li><li> A range expression outside the POSIX locale. For example, in some
-locales ‘<samp>[a-z]</samp>’ might match some characters that are
not
+</li><li>A range expression outside the POSIX locale. For example, in some
+locales ‘<samp class="samp">[a-z]</samp>’ might match some
characters that are not
lowercase letters, or might not match some lowercase letters, or might
-be invalid. With GNU <code>grep</code> it is not documented whether
+be invalid. With GNU <code class="command">grep</code> it is not documented
whether
these range expressions use native code points, or use the collating
-sequence specified by the <code>LC_COLLATE</code> category, or have some
+sequence specified by the <code class="env">LC_COLLATE</code> category, or
have some
other interpretation. Outside the POSIX locale, it is portable to use
-‘<samp>[[:lower:]]</samp>’ to match a lower-case letter, or
-‘<samp>[abcdefghijklmnopqrstuvwxyz]</samp>’ to match an ASCII
lower-case
+‘<samp class="samp">[[:lower:]]</samp>’ to match a lower-case
letter, or
+‘<samp class="samp">[abcdefghijklmnopqrstuvwxyz]</samp>’ to match
an ASCII lower-case
letter.
</li></ul>
<hr>
</div>
-<div class="section" id="Character-Encoding">
-<div class="header">
+<div class="section-level-extent" id="Character-Encoding">
+<div class="nav-panel">
<p>
Next: <a href="#Matching-Non_002dASCII" accesskey="n" rel="next">Matching
Non-ASCII and Non-printable Characters</a>, Previous: <a
href="#Problematic-Expressions" accesskey="p" rel="prev">Problematic Regular
Expressions</a>, Up: <a href="#Regular-Expressions" accesskey="u"
rel="up">Regular Expressions</a> [<a href="#SEC_Contents" title="Table
of contents" rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Character-Encoding-1"></span><h3 class="section">3.8 Character
Encoding</h3>
-<span id="index-character-encoding"></span>
+<h3 class="section" id="Character-Encoding-1"><span>3.8 Character Encoding<a
class="copiable-link" href="#Character-Encoding-1"> ¶</a></span></h3>
+<a class="index-entry-id" id="index-character-encoding"></a>
-<p>The <code>LC_CTYPE</code> locale specifies the encoding of characters in
+<p>The <code class="env">LC_CTYPE</code> locale specifies the encoding of
characters in
patterns and data, that is, whether text is encoded in UTF-8, ASCII,
-or some other encoding. See <a href="#Environment-Variables">Environment
Variables</a>.
+or some other encoding. See <a class="xref"
href="#Environment-Variables">Environment Variables</a>.
</p>
-<p>In the ‘<samp>C</samp>’ or ‘<samp>POSIX</samp>’
locale, every character is encoded as
+<p>In the ‘<samp class="samp">C</samp>’ or ‘<samp
class="samp">POSIX</samp>’ locale, every character is encoded as
a single byte and every byte is a valid character. In more-complex
encodings such as UTF-8, a sequence of multiple bytes may be needed to
represent a character, and some bytes may be encoding errors that do
not contribute to the representation of any character. POSIX does not
-specify the behavior of <code>grep</code> when patterns or input data
+specify the behavior of <code class="command">grep</code> when patterns or
input data
contain encoding errors or null characters, so portable scripts should
-avoid such usage. As an extension to POSIX, GNU <code>grep</code> treats
+avoid such usage. As an extension to POSIX, GNU <code
class="command">grep</code> treats
null characters like any other character. However, unless the
-<samp>-a</samp> (<samp>--binary-files=text</samp>) option is used, the
+<samp class="option">-a</samp> (<samp
class="option">--binary-files=text</samp>) option is used, the
presence of null characters in input or of encoding errors in output
-causes GNU <code>grep</code> to treat the file as binary and suppress
-details about matches. See <a href="#File-and-Directory-Selection">File and
Directory Selection</a>.
+causes GNU <code class="command">grep</code> to treat the file as binary and
suppress
+details about matches. See <a class="xref"
href="#File-and-Directory-Selection">File and Directory Selection</a>.
</p>
<p>Regardless of locale, the 103 characters in the POSIX Portable
Character Set (a subset of ASCII) are always encoded as a single byte,
@@ -1902,361 +2006,361 @@
</p>
<hr>
</div>
-<div class="section" id="Matching-Non_002dASCII">
-<div class="header">
+<div class="section-level-extent" id="Matching-Non_002dASCII">
+<div class="nav-panel">
<p>
Previous: <a href="#Character-Encoding" accesskey="p" rel="prev">Character
Encoding</a>, Up: <a href="#Regular-Expressions" accesskey="u" rel="up">Regular
Expressions</a> [<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Matching-Non_002dASCII-and-Non_002dprintable-Characters"></span><h3
class="section">3.9 Matching Non-ASCII and Non-printable Characters</h3>
-<span id="index-non_002dASCII-matching"></span>
-<span id="index-non_002dprintable-matching"></span>
+<h3 class="section"
id="Matching-Non_002dASCII-and-Non_002dprintable-Characters"><span>3.9 Matching
Non-ASCII and Non-printable Characters<a class="copiable-link"
href="#Matching-Non_002dASCII-and-Non_002dprintable-Characters">
¶</a></span></h3>
+<a class="index-entry-id" id="index-non_002dASCII-matching"></a>
+<a class="index-entry-id" id="index-non_002dprintable-matching"></a>
<p>In a regular expression, non-ASCII and non-printable characters other
than newline are not special, and represent themselves. For example,
-in a locale using UTF-8 the command ‘<samp>grep
'Î Ï'</samp>’ (where the
-white space between ‘<samp>Î</samp>’ and the
‘<samp>Ï</samp>’ is a tab character)
-searches for ‘<samp>Î</samp>’ (Unicode character U+039B GREEK
CAPITAL LETTER
-LAMBDA), followed by a tab (U+0009 TAB), followed by
‘<samp>Ï</samp>’ (U+03C9
+in a locale using UTF-8 the command ‘<samp class="samp">grep
'Î Ï'</samp>’ (where the
+white space between ‘<samp class="samp">Î</samp>’ and the
‘<samp class="samp">Ï</samp>’ is a tab character)
+searches for ‘<samp class="samp">Î</samp>’ (Unicode character
U+039B GREEK CAPITAL LETTER
+LAMBDA), followed by a tab (U+0009 TAB), followed by ‘<samp
class="samp">Ï</samp>’ (U+03C9
GREEK SMALL LETTER OMEGA).
</p>
<p>Suppose you want to limit your pattern to only printable characters
(or even only printable ASCII characters) to keep your script readable
or portable, but you also want to match specific non-ASCII or non-null
-non-printable characters. If you are using the <samp>-P</samp>
-(<samp>--perl-regexp</samp>) option, PCREs give you several ways to do
+non-printable characters. If you are using the <samp class="option">-P</samp>
+(<samp class="option">--perl-regexp</samp>) option, PCREs give you several
ways to do
this. Otherwise, if you are using Bash, the GNU project’s shell, you
can represent these characters via ANSI-C quoting. For example, the
-Bash commands ‘<samp>grep $'Î\tÏ'</samp>’ and ‘<samp>grep
$'\u039B\t\u03C9'</samp>’
-both search for the same three-character string
‘<samp>Î Ï</samp>’
+Bash commands ‘<samp class="samp">grep $'Î\tÏ'</samp>’ and
‘<samp class="samp">grep $'\u039B\t\u03C9'</samp>’
+both search for the same three-character string ‘<samp
class="samp">Î Ï</samp>’
mentioned earlier. However, because Bash translates ANSI-C quoting
-before <code>grep</code> sees the pattern, this technique should not be
-used to match printable ASCII characters; for example, ‘<samp>grep
-$'\u005E'</samp>’ is equivalent to ‘<samp>grep '^'</samp>’
and matches any line, not
-just lines containing the character ‘<samp>^</samp>’ (U+005E
CIRCUMFLEX
+before <code class="command">grep</code> sees the pattern, this technique
should not be
+used to match printable ASCII characters; for example, ‘<samp
class="samp">grep
+$'\u005E'</samp>’ is equivalent to ‘<samp class="samp">grep
'^'</samp>’ and matches any line, not
+just lines containing the character ‘<samp class="samp">^</samp>’
(U+005E CIRCUMFLEX
ACCENT).
</p>
<p>Since PCREs and ANSI-C quoting are GNU extensions to POSIX, portable
shell scripts written in ASCII should use other methods to match
specific non-ASCII characters. For example, in a UTF-8 locale the
-command ‘<samp>grep "$(printf
'\316\233\t\317\211\n')"</samp>’ is a portable
-albeit hard-to-read alternative to Bash’s ‘<samp>grep
$'Î\tÏ'</samp>’.
+command ‘<samp class="samp">grep "$(printf
'\316\233\t\317\211\n')"</samp>’ is a portable
+albeit hard-to-read alternative to Bash’s ‘<samp class="samp">grep
$'Î\tÏ'</samp>’.
However, none of these techniques will let you put a null character
directly into a command-line pattern; null characters can appear only
-in a pattern specified via the <samp>-f</samp> (<samp>--file</samp>) option.
+in a pattern specified via the <samp class="option">-f</samp> (<samp
class="option">--file</samp>) option.
</p>
<hr>
</div>
</div>
-<div class="chapter" id="Usage">
-<div class="header">
+<div class="chapter-level-extent" id="Usage">
+<div class="nav-panel">
<p>
Next: <a href="#Performance" accesskey="n" rel="next">Performance</a>,
Previous: <a href="#Regular-Expressions" accesskey="p" rel="prev">Regular
Expressions</a>, Up: <a href="#Top" accesskey="u" rel="up">grep</a> [<a
href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a
href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
-<span id="Usage-1"></span><h2 class="chapter">4 Usage</h2>
+<h2 class="chapter" id="Usage-1"><span>4 Usage<a class="copiable-link"
href="#Usage-1"> ¶</a></span></h2>
-<span id="index-usage_002c-examples"></span>
-<p>Here is an example command that invokes GNU <code>grep</code>:
+<a class="index-entry-id" id="index-usage_002c-examples"></a>
+<p>Here is an example command that invokes GNU <code
class="command">grep</code>:
</p>
<div class="example">
-<pre class="example">grep -i 'hello.*world' menu.h main.c
+<pre class="example-preformatted">grep -i 'hello.*world' menu.h main.c
</pre></div>
-<p>This lists all lines in the files <samp>menu.h</samp> and
<samp>main.c</samp> that
-contain the string ‘<samp>hello</samp>’ followed by the string
‘<samp>world</samp>’;
-this is because ‘<samp>.*</samp>’ matches zero or more characters
within a line.
-See <a href="#Regular-Expressions">Regular Expressions</a>.
-The <samp>-i</samp> option causes <code>grep</code>
-to ignore case, causing it to match the line ‘<samp>Hello,
world!</samp>’, which
+<p>This lists all lines in the files <samp class="file">menu.h</samp> and
<samp class="file">main.c</samp> that
+contain the string ‘<samp class="samp">hello</samp>’ followed by
the string ‘<samp class="samp">world</samp>’;
+this is because ‘<samp class="samp">.*</samp>’ matches zero or
more characters within a line.
+See <a class="xref" href="#Regular-Expressions">Regular Expressions</a>.
+The <samp class="option">-i</samp> option causes <code
class="command">grep</code>
+to ignore case, causing it to match the line ‘<samp class="samp">Hello,
world!</samp>’, which
it would not otherwise match.
</p>
<p>Here is a more complex example,
showing the location and contents of any line
-containing ‘<samp>f</samp>’ and ending in
‘<samp>.c</samp>’,
+containing ‘<samp class="samp">f</samp>’ and ending in
‘<samp class="samp">.c</samp>’,
within all files in the current directory whose names
-start with non-‘<samp>.</samp>’, contain
‘<samp>g</samp>’, and end in ‘<samp>.h</samp>’.
-The <samp>-n</samp> option outputs line numbers, the <samp>--</samp> argument
+start with non-‘<samp class="samp">.</samp>’, contain ‘<samp
class="samp">g</samp>’, and end in ‘<samp
class="samp">.h</samp>’.
+The <samp class="option">-n</samp> option outputs line numbers, the <samp
class="option">--</samp> argument
treats any later arguments as file names not options even if
-<code>*g*.h</code> expands to a file name that starts with
‘<samp>-</samp>’,
-and the empty file <samp>/dev/null</samp> causes file names to be output
-even if only one file name happens to be of the form
‘<samp>*g*.h</samp>’.
+<code class="code">*g*.h</code> expands to a file name that starts with
‘<samp class="samp">-</samp>’,
+and the empty file <samp class="file">/dev/null</samp> causes file names to be
output
+even if only one file name happens to be of the form ‘<samp
class="samp">*g*.h</samp>’.
</p>
<div class="example">
-<pre class="example">grep -n -- 'f.*\.c$' *g*.h /dev/null
+<pre class="example-preformatted">grep -n -- 'f.*\.c$' *g*.h /dev/null
</pre></div>
<p>Note that the regular expression syntax used in the pattern differs
from the globbing syntax that the shell uses to match file names.
</p>
-<p>See <a href="#Invoking">Invoking <code>grep</code></a>, for more details
about
-how to invoke <code>grep</code>.
+<p>See <a class="xref" href="#Invoking">Invoking <code
class="command">grep</code></a>, for more details about
+how to invoke <code class="command">grep</code>.
</p>
-<span id="index-using-grep_002c-Q_0026A"></span>
-<span id="index-FAQ-about-grep-usage"></span>
-<p>Here are some common questions and answers about <code>grep</code> usage.
+<a class="index-entry-id" id="index-using-grep_002c-Q_0026A"></a>
+<a class="index-entry-id" id="index-FAQ-about-grep-usage"></a>
+<p>Here are some common questions and answers about <code
class="command">grep</code> usage.
</p>
-<ol>
+<ol class="enumerate">
<li> How can I list just the names of matching files?
<div class="example">
-<pre class="example">grep -l 'main' test-*.c
+<pre class="example-preformatted">grep -l 'main' test-*.c
</pre></div>
-<p>lists names of ‘<samp>test-*.c</samp>’ files in the current
directory whose contents
-mention ‘<samp>main</samp>’.
+<p>lists names of ‘<samp class="samp">test-*.c</samp>’ files in
the current directory whose contents
+mention ‘<samp class="samp">main</samp>’.
</p>
</li><li> How do I search directories recursively?
<div class="example">
-<pre class="example">grep -r 'hello' /home/gigi
+<pre class="example-preformatted">grep -r 'hello' /home/gigi
</pre></div>
-<p>searches for ‘<samp>hello</samp>’ in all files
-under the <samp>/home/gigi</samp> directory.
+<p>searches for ‘<samp class="samp">hello</samp>’ in all files
+under the <samp class="file">/home/gigi</samp> directory.
For more control over which files are searched,
-use <code>find</code> and <code>grep</code>.
+use <code class="command">find</code> and <code class="command">grep</code>.
For example, the following command searches only C files:
</p>
<div class="example">
-<pre class="example">find /home/gigi -name '*.c' ! -type d \
+<pre class="example-preformatted">find /home/gigi -name '*.c' ! -type d \
-exec grep -H 'hello' '{}' +
</pre></div>
<p>This differs from the command:
</p>
<div class="example">
-<pre class="example">grep -H 'hello' /home/gigi/*.c
+<pre class="example-preformatted">grep -H 'hello' /home/gigi/*.c
</pre></div>
-<p>which merely looks for ‘<samp>hello</samp>’ in non-hidden C
files in
-<samp>/home/gigi</samp> whose names end in ‘<samp>.c</samp>’.
-The <code>find</code> command line above is more similar to the command:
+<p>which merely looks for ‘<samp class="samp">hello</samp>’ in
non-hidden C files in
+<samp class="file">/home/gigi</samp> whose names end in ‘<samp
class="samp">.c</samp>’.
+The <code class="command">find</code> command line above is more similar to
the command:
</p>
<div class="example">
-<pre class="example">grep -r --include='*.c' 'hello' /home/gigi
+<pre class="example-preformatted">grep -r --include='*.c' 'hello' /home/gigi
</pre></div>
-</li><li> What if a pattern or file has a leading ‘<samp>-</samp>’?
+</li><li> What if a pattern or file has a leading ‘<samp
class="samp">-</samp>’?
For example:
<div class="example">
-<pre class="example">grep "$pattern" *
+<pre class="example-preformatted">grep "$pattern" *
</pre></div>
-<p>can behave unexpectedly if the value of ‘<samp>pattern</samp>’
begins with ‘<samp>-</samp>’,
-or if the ‘<samp>*</samp>’ expands to a file name with leading
‘<samp>-</samp>’.
-To avoid the problem, you can use <samp>-e</samp> for patterns and leading
-‘<samp>./</samp>’ for files:
+<p>can behave unexpectedly if the value of ‘<samp
class="samp">pattern</samp>’ begins with ‘<samp
class="samp">-</samp>’,
+or if the ‘<samp class="samp">*</samp>’ expands to a file name
with leading ‘<samp class="samp">-</samp>’.
+To avoid the problem, you can use <samp class="option">-e</samp> for patterns
and leading
+‘<samp class="samp">./</samp>’ for files:
</p>
<div class="example">
-<pre class="example">grep -e "$pattern" ./*
+<pre class="example-preformatted">grep -e "$pattern" ./*
</pre></div>
<p>searches for all lines matching the pattern in all the working
-directory’s files whose names do not begin with
‘<samp>.</samp>’.
-Without the <samp>-e</samp>, <code>grep</code> might treat the pattern as an
-option if it begins with ‘<samp>-</samp>’. Without the
‘<samp>./</samp>’, there might
-be similar problems with file names beginning with
‘<samp>-</samp>’.
+directory’s files whose names do not begin with ‘<samp
class="samp">.</samp>’.
+Without the <samp class="option">-e</samp>, <code class="command">grep</code>
might treat the pattern as an
+option if it begins with ‘<samp class="samp">-</samp>’. Without
the ‘<samp class="samp">./</samp>’, there might
+be similar problems with file names beginning with ‘<samp
class="samp">-</samp>’.
</p>
-<p>Alternatively, you can use ‘<samp>--</samp>’ before the pattern
and file names:
+<p>Alternatively, you can use ‘<samp class="samp">--</samp>’
before the pattern and file names:
</p>
<div class="example">
-<pre class="example">grep -- "$pattern" *
+<pre class="example-preformatted">grep -- "$pattern" *
</pre></div>
-<p>This also fixes the problem, except that if there is a file named
‘<samp>-</samp>’,
-<code>grep</code> misinterprets the ‘<samp>-</samp>’ as standard
input.
+<p>This also fixes the problem, except that if there is a file named
‘<samp class="samp">-</samp>’,
+<code class="command">grep</code> misinterprets the ‘<samp
class="samp">-</samp>’ as standard input.
</p>
</li><li> Suppose I want to search for a whole word, not a part of a word?
<div class="example">
-<pre class="example">grep -w 'hello' test*.log
+<pre class="example-preformatted">grep -w 'hello' test*.log
</pre></div>
-<p>searches only for instances of ‘<samp>hello</samp>’ that are
entire words;
-it does not match ‘<samp>Othello</samp>’.
-For more control, use ‘<samp>\<</samp>’ and
-‘<samp>\></samp>’ to match the start and end of words.
+<p>searches only for instances of ‘<samp
class="samp">hello</samp>’ that are entire words;
+it does not match ‘<samp class="samp">Othello</samp>’.
+For more control, use ‘<samp class="samp">\<</samp>’ and
+‘<samp class="samp">\></samp>’ to match the start and end of
words.
For example:
</p>
<div class="example">
-<pre class="example">grep 'hello\>' test*.log
+<pre class="example-preformatted">grep 'hello\>' test*.log
</pre></div>
-<p>searches only for words ending in ‘<samp>hello</samp>’, so it
matches the word
-‘<samp>Othello</samp>’.
+<p>searches only for words ending in ‘<samp
class="samp">hello</samp>’, so it matches the word
+‘<samp class="samp">Othello</samp>’.
</p>
</li><li> How do I output context around the matching lines?
<div class="example">
-<pre class="example">grep -C 2 'hello' test*.log
+<pre class="example-preformatted">grep -C 2 'hello' test*.log
</pre></div>
<p>prints two lines of context around each matching line.
</p>
-</li><li> How do I force <code>grep</code> to print the name of the file?
+</li><li> How do I force <code class="command">grep</code> to print the name
of the file?
-<p>Append <samp>/dev/null</samp>:
+<p>Append <samp class="file">/dev/null</samp>:
</p>
<div class="example">
-<pre class="example">grep 'eli' /etc/passwd /dev/null
+<pre class="example-preformatted">grep 'eli' /etc/passwd /dev/null
</pre></div>
<p>gets you:
</p>
<div class="example">
-<pre class="example">/etc/passwd:eli:x:2098:1000:Eli Smith:/home/eli:/bin/bash
+<pre class="example-preformatted">/etc/passwd:eli:x:2098:1000:Eli
Smith:/home/eli:/bin/bash
</pre></div>
-<p>Alternatively, use <samp>-H</samp>, which is a GNU extension:
+<p>Alternatively, use <samp class="option">-H</samp>, which is a GNU extension:
</p>
<div class="example">
-<pre class="example">grep -H 'eli' /etc/passwd
+<pre class="example-preformatted">grep -H 'eli' /etc/passwd
</pre></div>
-</li><li> Why do people use strange regular expressions on <code>ps</code>
output?
+</li><li> Why do people use strange regular expressions on <code
class="command">ps</code> output?
<div class="example">
-<pre class="example">ps -ef | grep '[c]ron'
+<pre class="example-preformatted">ps -ef | grep '[c]ron'
</pre></div>
<p>If the pattern had been written without the square brackets, it would
-have matched not only the <code>ps</code> output line for <code>cron</code>,
-but also the <code>ps</code> output line for <code>grep</code>.
+have matched not only the <code class="command">ps</code> output line for
<code class="command">cron</code>,
+but also the <code class="command">ps</code> output line for <code
class="command">grep</code>.
Note that on some platforms,
-<code>ps</code> limits the output to the width of the screen;
-<code>grep</code> does not have any limit on the length of a line
+<code class="command">ps</code> limits the output to the width of the screen;
+<code class="command">grep</code> does not have any limit on the length of a
line
except the available memory.
</p>
-</li><li> Why does <code>grep</code> report “Binary file matches”?
+</li><li> Why does <code class="command">grep</code> report “Binary file
matches”?
-<p>If <code>grep</code> listed all matching “lines” from a binary
file, it
+<p>If <code class="command">grep</code> listed all matching
“lines” from a binary file, it
would probably generate output that is not useful, and it might even
muck up your display.
-So GNU <code>grep</code> suppresses output from
+So GNU <code class="command">grep</code> suppresses output from
files that appear to be binary files.
-To force GNU <code>grep</code>
+To force GNU <code class="command">grep</code>
to output lines even from files that appear to be binary, use the
-<samp>-a</samp> or ‘<samp>--binary-files=text</samp>’ option.
+<samp class="option">-a</samp> or ‘<samp
class="samp">--binary-files=text</samp>’ option.
To eliminate the
-“Binary file matches” messages, use the <samp>-I</samp> or
-‘<samp>--binary-files=without-match</samp>’ option.
+“Binary file matches” messages, use the <samp
class="option">-I</samp> or
+‘<samp class="samp">--binary-files=without-match</samp>’ option.
</p>
-</li><li> Why doesn’t ‘<samp>grep -lv</samp>’ print
non-matching file names?
+</li><li> Why doesn’t ‘<samp class="samp">grep -lv</samp>’
print non-matching file names?
-<p>‘<samp>grep -lv</samp>’ lists the names of all files containing
one or more
+<p>‘<samp class="samp">grep -lv</samp>’ lists the names of all
files containing one or more
lines that do not match.
To list the names of all files that contain no
-matching lines, use the <samp>-L</samp> or <samp>--files-without-match</samp>
+matching lines, use the <samp class="option">-L</samp> or <samp
class="option">--files-without-match</samp>
option.
</p>
-</li><li> I can do “OR” with ‘<samp>|</samp>’, but
what about “AND”?
+</li><li> I can do “OR” with ‘<samp
class="samp">|</samp>’, but what about “AND”?
<div class="example">
-<pre class="example">grep 'paul' /etc/motd | grep 'franc,ois'
+<pre class="example-preformatted">grep 'paul' /etc/motd | grep 'franc,ois'
</pre></div>
-<p>finds all lines that contain both ‘<samp>paul</samp>’ and
‘<samp>franc,ois</samp>’.
+<p>finds all lines that contain both ‘<samp
class="samp">paul</samp>’ and ‘<samp
class="samp">franc,ois</samp>’.
</p>
</li><li> Why does the empty pattern match every input line?
-<p>The <code>grep</code> command searches for lines that contain strings
+<p>The <code class="command">grep</code> command searches for lines that
contain strings
that match a pattern. Every line contains the empty string, so an
-empty pattern causes <code>grep</code> to find a match on each line. It
-is not the only such pattern: ‘<samp>^</samp>’,
‘<samp>$</samp>’, and many
-other patterns cause <code>grep</code> to match every line.
-</p>
-<p>To match empty lines, use the pattern ‘<samp>^$</samp>’. To
match blank
-lines, use the pattern ‘<samp>^[[:blank:]]*$</samp>’. To match no
lines at
-all, use an extended regular expression like ‘<samp>a^</samp>’ or
‘<samp>$a</samp>’.
+empty pattern causes <code class="command">grep</code> to find a match on each
line. It
+is not the only such pattern: ‘<samp class="samp">^</samp>’,
‘<samp class="samp">$</samp>’, and many
+other patterns cause <code class="command">grep</code> to match every line.
+</p>
+<p>To match empty lines, use the pattern ‘<samp
class="samp">^$</samp>’. To match blank
+lines, use the pattern ‘<samp class="samp">^[[:blank:]]*$</samp>’.
To match no lines at
+all, use an extended regular expression like ‘<samp
class="samp">a^</samp>’ or ‘<samp class="samp">$a</samp>’.
To match every line, a portable script should use a pattern like
-‘<samp>^</samp>’ instead of the empty pattern, as POSIX does not
specify the
+‘<samp class="samp">^</samp>’ instead of the empty pattern, as
POSIX does not specify the
behavior of the empty pattern.
</p>
</li><li> How can I search in both standard input and in files?
-<p>Use the special file name ‘<samp>-</samp>’:
+<p>Use the special file name ‘<samp class="samp">-</samp>’:
</p>
<div class="example">
-<pre class="example">cat /etc/passwd | grep 'alain' - /etc/motd
+<pre class="example-preformatted">cat /etc/passwd | grep 'alain' - /etc/motd
</pre></div>
-</li><li> Why can’t I combine the shell’s ‘<samp>set
-e</samp>’ with <code>grep</code>?
+</li><li> Why can’t I combine the shell’s ‘<samp
class="samp">set -e</samp>’ with <code class="command">grep</code>?
-<p>The <code>grep</code> command follows the convention of programs like
-<code>cmp</code> and <code>diff</code> where an exit status of 1 is not an
-error. The shell command ‘<samp>set -e</samp>’ causes the shell
to exit if
+<p>The <code class="command">grep</code> command follows the convention of
programs like
+<code class="command">cmp</code> and <code class="command">diff</code> where
an exit status of 1 is not an
+error. The shell command ‘<samp class="samp">set -e</samp>’
causes the shell to exit if
any subcommand exits with nonzero status, and this will cause the
-shell to exit merely because <code>grep</code> selected no lines,
+shell to exit merely because <code class="command">grep</code> selected no
lines,
which is ordinarily not what you want.
</p>
-<p>There is a related problem with Bash’s <code>set -e -o
pipefail</code>.
-Since <code>grep</code> does not always read all its input, a command
-outputting to a pipe read by <code>grep</code> can fail when
-<code>grep</code> exits before reading all its input, and the command’s
+<p>There is a related problem with Bash’s <code class="command">set -e
-o pipefail</code>.
+Since <code class="command">grep</code> does not always read all its input, a
command
+outputting to a pipe read by <code class="command">grep</code> can fail when
+<code class="command">grep</code> exits before reading all its input, and the
command’s
failure can cause Bash to exit.
</p>
</li><li> Why is this back-reference failing?
<div class="example">
-<pre class="example">echo 'ba' | grep -E '(a)\1|b\1'
+<pre class="example-preformatted">echo 'ba' | grep -E '(a)\1|b\1'
</pre></div>
-<p>This outputs an error message, because the second
‘<samp>\1</samp>’
+<p>This outputs an error message, because the second ‘<samp
class="samp">\1</samp>’
has nothing to refer back to, meaning it will never match anything.
</p>
</li><li> How can I match across lines?
<p>Standard grep cannot do this, as it is fundamentally line-based.
-Therefore, merely using the <code>[:space:]</code> character class does not
+Therefore, merely using the <code class="code">[:space:]</code> character
class does not
match newlines in the way you might expect.
</p>
-<p>With the GNU <code>grep</code> option <samp>-z</samp>
(<samp>--null-data</samp>), each
-input and output “line” is null-terminated; see <a
href="#Other-Options">Other Options</a>. Thus,
+<p>With the GNU <code class="command">grep</code> option <samp
class="option">-z</samp> (<samp class="option">--null-data</samp>), each
+input and output “line” is null-terminated; see <a class="pxref"
href="#Other-Options">Other Options</a>. Thus,
you can match newlines in the input, but typically if there is a match
the entire input is output, so this usage is often combined with
-output-suppressing options like <samp>-q</samp>, e.g.:
+output-suppressing options like <samp class="option">-q</samp>, e.g.:
</p>
<div class="example">
-<pre class="example">printf 'foo\nbar\n' | grep -z -q 'foo[[:space:]]\+bar'
+<pre class="example-preformatted">printf 'foo\nbar\n' | grep -z -q
'foo[[:space:]]\+bar'
</pre></div>
<p>If this does not suffice, you can transform the input
-before giving it to <code>grep</code>, or turn to <code>awk</code>,
-<code>sed</code>, <code>perl</code>, or many other utilities that are
+before giving it to <code class="command">grep</code>, or turn to <code
class="command">awk</code>,
+<code class="command">sed</code>, <code class="command">perl</code>, or many
other utilities that are
designed to operate across lines.
</p>
-</li><li> What do <code>grep</code>, <samp>-E</samp>, and <samp>-F</samp>
stand for?
+</li><li> What do <code class="command">grep</code>, <samp
class="option">-E</samp>, and <samp class="option">-F</samp> stand for?
-<p>The name <code>grep</code> comes from the way line editing was done on Unix.
+<p>The name <code class="command">grep</code> comes from the way line editing
was done on Unix.
For example,
-<code>ed</code> uses the following syntax
+<code class="command">ed</code> uses the following syntax
to print a list of matching lines on the screen:
</p>
<div class="example">
-<pre class="example">global/regular expression/print
+<pre class="example-preformatted">global/regular expression/print
g/re/p
</pre></div>
-<p>The <samp>-E</samp> option stands for Extended <code>grep</code>.
-The <samp>-F</samp> option stands for Fixed <code>grep</code>;
+<p>The <samp class="option">-E</samp> option stands for Extended <code
class="command">grep</code>.
+The <samp class="option">-F</samp> option stands for Fixed <code
class="command">grep</code>;
</p>
-</li><li> What happened to <code>egrep</code> and <code>fgrep</code>?
+</li><li> What happened to <code class="command">egrep</code> and <code
class="command">fgrep</code>?
-<p>7th Edition Unix had commands <code>egrep</code> and <code>fgrep</code>
-that were the counterparts of the modern ‘<samp>grep -E</samp>’
and ‘<samp>grep -F</samp>’.
-Although breaking up <code>grep</code> into three programs was perhaps
-useful on the small computers of the 1970s, <code>egrep</code> and
-<code>fgrep</code> were not standardized by POSIX and are no longer needed.
-In the current GNU implementation, <code>egrep</code> and <code>fgrep</code>
-issue a warning and then act like their modern counterparts;
+<p>7th Edition Unix had commands <code class="command">egrep</code> and <code
class="command">fgrep</code>
+that were the counterparts of the modern ‘<samp class="samp">grep
-E</samp>’ and ‘<samp class="samp">grep -F</samp>’.
+Although breaking up <code class="command">grep</code> into three programs was
perhaps
+useful on the small computers of the 1970s, <code class="command">egrep</code>
and
+<code class="command">fgrep</code> were deemed obsolescent by POSIX in 1992,
+removed from POSIX in 2001, deprecated by GNU Grep 2.5.3 in 2007,
+and changed to issue obsolescence warnings by GNU Grep 3.8 in 2022;
eventually, they are planned to be removed entirely.
</p>
<p>If you prefer the old names, you can use use your own substitutes,
-such as a shell script named <code>egrep</code> with the following
+such as a shell script named <code class="command">egrep</code> with the
following
contents:
</p>
<div class="example">
-<pre class="example">#!/bin/sh
+<pre class="example-preformatted">#!/bin/sh
exec grep -E "$@"
</pre></div>
@@ -2265,155 +2369,155 @@
<hr>
</div>
-<div class="chapter" id="Performance">
-<div class="header">
+<div class="chapter-level-extent" id="Performance">
+<div class="nav-panel">
<p>
Next: <a href="#Reporting-Bugs" accesskey="n" rel="next">Reporting bugs</a>,
Previous: <a href="#Usage" accesskey="p" rel="prev">Usage</a>, Up: <a
href="#Top" accesskey="u" rel="up">grep</a> [<a href="#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a href="#Index"
title="Index" rel="index">Index</a>]</p>
</div>
-<span id="Performance-1"></span><h2 class="chapter">5 Performance</h2>
+<h2 class="chapter" id="Performance-1"><span>5 Performance<a
class="copiable-link" href="#Performance-1"> ¶</a></span></h2>
-<span id="index-performance"></span>
-<p>Typically <code>grep</code> is an efficient way to search text. However,
+<a class="index-entry-id" id="index-performance"></a>
+<p>Typically <code class="command">grep</code> is an efficient way to search
text. However,
it can be quite slow in some cases, and it can search large files
where even minor performance tweaking can help significantly.
-Although the algorithm used by <code>grep</code> is an implementation
+Although the algorithm used by <code class="command">grep</code> is an
implementation
detail that can change from release to release, understanding its
basic strengths and weaknesses can help you improve its performance.
</p>
-<p>The <code>grep</code> command operates partly via a set of automata that
+<p>The <code class="command">grep</code> command operates partly via a set of
automata that
are designed for efficiency, and partly via a slower matcher that
takes over when the fast matchers run into unusual features like
back-references. When feasible, the Boyer–Moore fast string
searching algorithm is used to match a single fixed pattern, and the
Aho–Corasick algorithm is used to match multiple fixed patterns.
</p>
-<span id="index-locales"></span>
-<p>Generally speaking <code>grep</code> operates more efficiently in
+<a class="index-entry-id" id="index-locales"></a>
+<p>Generally speaking <code class="command">grep</code> operates more
efficiently in
single-byte locales, since it can avoid the special processing needed
for multi-byte characters. If your patterns will work just as well
-that way, setting <code>LC_ALL</code> to a single-byte locale can help
-performance considerably. Setting ‘<samp>LC_ALL='C'</samp>’ can be
-particularly efficient, as <code>grep</code> is tuned for that locale.
-</p>
-<span id="index-case-insensitive-search-1"></span>
-<p>Outside the ‘<samp>C</samp>’ locale, case-insensitive search,
and search for
-bracket expressions like ‘<samp>[a-z]</samp>’ and
‘<samp>[[=a=]b]</samp>’, can be
+that way, setting <code class="env">LC_ALL</code> to a single-byte locale can
help
+performance considerably. Setting ‘<samp
class="samp">LC_ALL='C'</samp>’ can be
+particularly efficient, as <code class="command">grep</code> is tuned for that
locale.
+</p>
+<a class="index-entry-id" id="index-case-insensitive-search-1"></a>
+<p>Outside the ‘<samp class="samp">C</samp>’ locale,
case-insensitive search, and search for
+bracket expressions like ‘<samp class="samp">[a-z]</samp>’ and
‘<samp class="samp">[[=a=]b]</samp>’, can be
surprisingly inefficient due to difficulties in fast portable access to
concepts like multi-character collating elements.
</p>
-<span id="index-interval-expressions-1"></span>
+<a class="index-entry-id" id="index-interval-expressions-1"></a>
<p>Interval expressions may be implemented internally via repetition.
-For example, ‘<samp>^(a|bc){2,4}$</samp>’ might be implemented as
-‘<samp>^(a|bc)(a|bc)((a|bc)(a|bc)?)?$</samp>’. A large repetition
count may
+For example, ‘<samp class="samp">^(a|bc){2,4}$</samp>’ might be
implemented as
+‘<samp class="samp">^(a|bc)(a|bc)((a|bc)(a|bc)?)?$</samp>’. A
large repetition count may
exhaust memory or greatly slow matching. Even small counts can cause
-problems if cascaded; for example, ‘<samp>grep -E
+problems if cascaded; for example, ‘<samp class="samp">grep -E
".*{10,}{10,}{10,}{10,}{10,}"</samp>’ is likely to overflow a
stack. Fortunately, regular expressions like these are typically
artificial, and cascaded repetitions do not conform to POSIX so cannot
be used in portable programs anyway.
</p>
-<span id="index-back_002dreferences"></span>
-<p>A back-reference such as ‘<samp>\1</samp>’ can hurt performance
significantly
+<a class="index-entry-id" id="index-back_002dreferences"></a>
+<p>A back-reference such as ‘<samp class="samp">\1</samp>’ can
hurt performance significantly
in some cases, since back-references cannot in general be implemented
via a finite state automaton, and instead trigger a backtracking
algorithm that can be quite inefficient. For example, although the
-pattern ‘<samp>^(.*)\1{14}(.*)\2{13}$</samp>’ matches only lines
whose
-lengths can be written as a sum <em class='math'>15x + 14y</em> for nonnegative
-integers <em class='math'>x</em> and <em class='math'>y</em>, the pattern
matcher does not perform
+pattern ‘<samp class="samp">^(.*)\1{14}(.*)\2{13}$</samp>’ matches
only lines whose
+lengths can be written as a sum <em class="math">15x + 14y</em> for nonnegative
+integers <em class="math">x</em> and <em class="math">y</em>, the pattern
matcher does not perform
linear Diophantine analysis and instead backtracks through all
possible matching strings, using an algorithm that is exponential in
the worst case.
</p>
-<span id="index-holes-in-files"></span>
+<a class="index-entry-id" id="index-holes-in-files"></a>
<p>On some operating systems that support files with holes—large
regions of zeros that are not physically present on secondary
-storage—<code>grep</code> can skip over the holes efficiently without
+storage—<code class="command">grep</code> can skip over the holes
efficiently without
needing to read the zeros. This optimization is not available if the
-<samp>-a</samp> (<samp>--binary-files=text</samp>) option is used (see <a
href="#File-and-Directory-Selection">File and Directory Selection</a>), unless
the <samp>-z</samp> (<samp>--null-data</samp>)
-option is also used (see <a href="#Other-Options">Other Options</a>).
+<samp class="option">-a</samp> (<samp
class="option">--binary-files=text</samp>) option is used (see <a class="pxref"
href="#File-and-Directory-Selection">File and Directory Selection</a>), unless
the <samp class="option">-z</samp> (<samp class="option">--null-data</samp>)
+option is also used (see <a class="pxref" href="#Other-Options">Other
Options</a>).
</p>
-<span id="index-pipelines-and-reading"></span>
-<p>For efficiency <code>grep</code> does not always read all its input.
-For example, the shell command ‘<samp>sed '/^...$/d' | grep -q
X</samp>’ can
-cause <code>grep</code> to exit immediately after reading a line
-containing ‘<samp>X</samp>’, without bothering to read the rest of
its input data.
-This in turn can cause <code>sed</code> to exit with a nonzero status because
-<code>sed</code> cannot write to its output pipe after <code>grep</code> exits.
+<a class="index-entry-id" id="index-pipelines-and-reading"></a>
+<p>For efficiency <code class="command">grep</code> does not always read all
its input.
+For example, the shell command ‘<samp class="samp">sed '/^...$/d' | grep
-q X</samp>’ can
+cause <code class="command">grep</code> to exit immediately after reading a
line
+containing ‘<samp class="samp">X</samp>’, without bothering to
read the rest of its input data.
+This in turn can cause <code class="command">sed</code> to exit with a nonzero
status because
+<code class="command">sed</code> cannot write to its output pipe after <code
class="command">grep</code> exits.
</p>
-<p>For more about the algorithms used by <code>grep</code> and about
+<p>For more about the algorithms used by <code class="command">grep</code> and
about
related string matching algorithms, see:
</p>
-<ul>
-<li> Aho AV. Algorithms for finding patterns in strings.
-In: van Leeuwen J. <em>Handbook of Theoretical Computer Science</em>, vol. A.
+<ul class="itemize mark-bullet">
+<li>Aho AV. Algorithms for finding patterns in strings.
+In: van Leeuwen J. <em class="emph">Handbook of Theoretical Computer
Science</em>, vol. A.
New York: Elsevier; 1990. p. 255–300.
This surveys classic string matching algorithms, some of which are
-used by <code>grep</code>.
+used by <code class="command">grep</code>.
-</li><li> Aho AV, Corasick MJ. Efficient string matching: an aid to
bibliographic search.
-<em>CACM</em>. 1975;18(6):333–40.
-<a
href="https://doi.org/10.1145/360825.360855";>https://doi.org/10.1145/360825.360855</a>.
+</li><li>Aho AV, Corasick MJ. Efficient string matching: an aid to
bibliographic search.
+<em class="emph">CACM</em>. 1975;18(6):333–40.
+<a class="url"
href="https://doi.org/10.1145/360825.360855";>https://doi.org/10.1145/360825.360855</a>.
This introduces the Aho–Corasick algorithm.
-</li><li> Boyer RS, Moore JS. A fast string searching algorithm.
-<em>CACM</em>. 1977;20(10):762–72.
-<a
href="https://doi.org/10.1145/359842.359859";>https://doi.org/10.1145/359842.359859</a>.
+</li><li>Boyer RS, Moore JS. A fast string searching algorithm.
+<em class="emph">CACM</em>. 1977;20(10):762–72.
+<a class="url"
href="https://doi.org/10.1145/359842.359859";>https://doi.org/10.1145/359842.359859</a>.
This introduces the Boyer–Moore algorithm.
-</li><li> Faro S, Lecroq T. The exact online string matching problem: a review
+</li><li>Faro S, Lecroq T. The exact online string matching problem: a review
of the most recent results.
-<em>ACM Comput Surv</em>. 2013;45(2):13.
-<a
href="https://doi.org/10.1145/2431211.2431212";>https://doi.org/10.1145/2431211.2431212</a>.
+<em class="emph">ACM Comput Surv</em>. 2013;45(2):13.
+<a class="url"
href="https://doi.org/10.1145/2431211.2431212";>https://doi.org/10.1145/2431211.2431212</a>.
This surveys string matching algorithms that might help improve the
-performance of <code>grep</code> in the future.
+performance of <code class="command">grep</code> in the future.
-</li><li> Hakak SI, Kamsin A, Shivakumara P, Gilkar GA, Khan WZ, Imran M.
+</li><li>Hakak SI, Kamsin A, Shivakumara P, Gilkar GA, Khan WZ, Imran M.
Exact string matching algorithms: survey issues, and future research
directions.
-<em>IEEE Access</em>. 2019;7:69614–37.
-<a
href="https://doi.org/10.1109/ACCESS.2019.2914071";>https://doi.org/10.1109/ACCESS.2019.2914071</a>.
+<em class="emph">IEEE Access</em>. 2019;7:69614–37.
+<a class="url"
href="https://doi.org/10.1109/ACCESS.2019.2914071";>https://doi.org/10.1109/ACCESS.2019.2914071</a>.
This survey is more recent than Faro & Lecroq,
and focuses on taxonomy instead of performance.
-</li><li> Hume A, Sunday D. Fast string search.
-<em>Software Pract Exper</em>. 1991;21(11):1221–48.
-<a
href="https://doi.org/10.1002/spe.4380211105";>https://doi.org/10.1002/spe.4380211105</a>.
+</li><li>Hume A, Sunday D. Fast string search.
+<em class="emph">Software Pract Exper</em>. 1991;21(11):1221–48.
+<a class="url"
href="https://doi.org/10.1002/spe.4380211105";>https://doi.org/10.1002/spe.4380211105</a>.
This excellent albeit now-dated survey aided the initial development
-of <code>grep</code>.
+of <code class="command">grep</code>.
</li></ul>
<hr>
</div>
-<div class="chapter" id="Reporting-Bugs">
-<div class="header">
+<div class="chapter-level-extent" id="Reporting-Bugs">
+<div class="nav-panel">
<p>
Next: <a href="#Copying" accesskey="n" rel="next">Copying</a>, Previous: <a
href="#Performance" accesskey="p" rel="prev">Performance</a>, Up: <a
href="#Top" accesskey="u" rel="up">grep</a> [<a href="#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a href="#Index"
title="Index" rel="index">Index</a>]</p>
</div>
-<span id="Reporting-bugs"></span><h2 class="chapter">6 Reporting bugs</h2>
+<h2 class="chapter" id="Reporting-bugs"><span>6 Reporting bugs<a
class="copiable-link" href="#Reporting-bugs"> ¶</a></span></h2>
-<span id="index-bugs_002c-reporting"></span>
+<a class="index-entry-id" id="index-bugs_002c-reporting"></a>
<p>Bug reports can be found at the
-<a href="https://debbugs.gnu.org/cgi/pkgreport.cgi?package=grep";>GNU bug
report logs for <code>grep</code></a>.
+<a class="url"
href="https://debbugs.gnu.org/cgi/pkgreport.cgi?package=grep";>GNU bug report
logs for <code class="command">grep</code></a>.
If you find a bug not listed there, please email it to
-<a href="mailto:bug-grep@gnu.org";>bug-grep@gnu.org</a> to create a new bug
report.
+<a class="email" href="mailto:bug-grep@gnu.org";>bug-grep@gnu.org</a> to create
a new bug report.
</p>
-<ul class="section-toc">
+<ul class="mini-toc">
<li><a href="#Known-Bugs" accesskey="1">Known Bugs</a></li>
</ul>
<hr>
-<div class="section" id="Known-Bugs">
-<div class="header">
+<div class="section-level-extent" id="Known-Bugs">
+<div class="nav-panel">
<p>
Up: <a href="#Reporting-Bugs" accesskey="u" rel="up">Reporting bugs</a>
[<a href="#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href="#Index" title="Index"
rel="index">Index</a>]</p>
</div>
-<span id="Known-Bugs-1"></span><h3 class="section">6.1 Known Bugs</h3>
-<span id="index-Bugs_002c-known"></span>
+<h3 class="section" id="Known-Bugs-1"><span>6.1 Known Bugs<a
class="copiable-link" href="#Known-Bugs-1"> ¶</a></span></h3>
+<a class="index-entry-id" id="index-Bugs_002c-known"></a>
-<p>Large repetition counts in the ‘<samp>{n,m}</samp>’ construct
may cause
-<code>grep</code> to use lots of memory.
+<p>Large repetition counts in the ‘<samp
class="samp">{n,m}</samp>’ construct may cause
+<code class="command">grep</code> to use lots of memory.
In addition, certain other
obscure regular expressions require exponential time and
-space, and may cause <code>grep</code> to run out of memory.
+space, and may cause <code class="command">grep</code> to run out of memory.
</p>
<p>Back-references can greatly slow down matching, as they can generate
exponentially many matching possibilities that can consume both time
@@ -2422,13 +2526,13 @@
expression implementations have back-reference bugs that can cause
programs to return incorrect answers or even crash, and fixing these
bugs has often been low-priority: for example, as of 2021 the
-<a href="https://sourceware.org/bugzilla/";>GNU C library bug database</a>
+<a class="url" href="https://sourceware.org/bugzilla/";>GNU C library bug
database</a>
contained back-reference bugs
-<a href="https://sourceware.org/bugzilla/show_bug.cgi?id=52";>52</a>,
-<a href="https://sourceware.org/bugzilla/show_bug.cgi?id=10844";>10844</a>,
-<a href="https://sourceware.org/bugzilla/show_bug.cgi?id=11053";>11053</a>,
-<a href="https://sourceware.org/bugzilla/show_bug.cgi?id=24269";>24269</a>
-and <a href="https://sourceware.org/bugzilla/show_bug.cgi?id=25322";>25322</a>,
+<a class="url"
href="https://sourceware.org/bugzilla/show_bug.cgi?id=52";>52</a>,
+<a class="url"
href="https://sourceware.org/bugzilla/show_bug.cgi?id=10844";>10844</a>,
+<a class="url"
href="https://sourceware.org/bugzilla/show_bug.cgi?id=11053";>11053</a>,
+<a class="url"
href="https://sourceware.org/bugzilla/show_bug.cgi?id=24269";>24269</a>
+and <a class="url"
href="https://sourceware.org/bugzilla/show_bug.cgi?id=25322";>25322</a>,
with little sign of forthcoming fixes. Luckily,
back-references are rarely useful and it should be little trouble to
avoid them in practical applications.
@@ -2437,63 +2541,64 @@
<hr>
</div>
</div>
-<div class="chapter" id="Copying">
-<div class="header">
+<div class="chapter-level-extent" id="Copying">
+<div class="nav-panel">
<p>
Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a
href="#Reporting-Bugs" accesskey="p" rel="prev">Reporting bugs</a>, Up: <a
href="#Top" accesskey="u" rel="up">grep</a> [<a href="#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a href="#Index"
title="Index" rel="index">Index</a>]</p>
</div>
-<span id="Copying-1"></span><h2 class="chapter">7 Copying</h2>
-<span id="index-copying"></span>
+<h2 class="chapter" id="Copying-1"><span>7 Copying<a class="copiable-link"
href="#Copying-1"> ¶</a></span></h2>
+<a class="index-entry-id" id="index-copying"></a>
-<p>GNU <code>grep</code> is licensed under the GNU GPL, which makes it <em>free
+<p>GNU <code class="command">grep</code> is licensed under the GNU GPL, which
makes it <em class="dfn">free
software</em>.
</p>
<p>The “free” in “free software” refers to liberty,
not price. As
some GNU project advocates like to point out, think of “free
speech”
rather than “free beer”. In short, you have the right (freedom) to
-run and change <code>grep</code> and distribute it to other people,
and—if you
+run and change <code class="command">grep</code> and distribute it to other
people, and—if you
want—charge money for doing either. The important restriction is
that you have to grant your recipients the same rights and impose the
same restrictions.
</p>
<p>This general method of licensing software is sometimes called
-<em>open source</em>. The GNU project prefers the term “free
software”
+<em class="dfn">open source</em>. The GNU project prefers the term
“free software”
for reasons outlined at
-<a
href="https://www.gnu.org/philosophy/open-source-misses-the-point.html";>https://www.gnu.org/philosophy/open-source-misses-the-point.html</a>.
+<a class="url"
href="https://www.gnu.org/philosophy/open-source-misses-the-point.html";>https://www.gnu.org/philosophy/open-source-misses-the-point.html</a>.
</p>
<p>This manual is free documentation in the same sense. The
documentation license is included below. The license for the program
is available with the source code, or at
-<a
href="https://www.gnu.org/licenses/gpl.html";>https://www.gnu.org/licenses/gpl.html</a>.
+<a class="url"
href="https://www.gnu.org/licenses/gpl.html";>https://www.gnu.org/licenses/gpl.html</a>.
</p>
-<ul class="section-toc">
+<ul class="mini-toc">
<li><a href="#GNU-Free-Documentation-License" accesskey="1">GNU Free
Documentation License</a></li>
</ul>
<hr>
-<div class="section" id="GNU-Free-Documentation-License">
-<div class="header">
+<div class="section-level-extent" id="GNU-Free-Documentation-License">
+<div class="nav-panel">
<p>
Up: <a href="#Copying" accesskey="u" rel="up">Copying</a> [<a
href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a
href="#Index" title="Index" rel="index">Index</a>]</p>
</div>
-<span id="GNU-Free-Documentation-License-1"></span><h3 class="section">7.1 GNU
Free Documentation License</h3>
+<h3 class="section" id="GNU-Free-Documentation-License-1"><span>7.1 GNU Free
Documentation License<a class="copiable-link"
href="#GNU-Free-Documentation-License-1"> ¶</a></span></h3>
-<div align="center">Version 1.3, 3 November 2008
+<div class="center">Version 1.3, 3 November 2008
</div>
<div class="display">
-<pre class="display">Copyright © 2000, 2001, 2002, 2007, 2008 Free
Software Foundation, Inc.
-<a href="https://fsf.org/";>https://fsf.org/</a>
+<pre class="display-preformatted">Copyright © 2000–2002,
2007–2008, 2023 Free Software Foundation,
+Inc.
+<a class="uref" href="https://fsf.org/";>https://fsf.org/</a>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</pre></div>
-<ol start="0">
+<ol class="enumerate" start="0">
<li> PREAMBLE
<p>The purpose of this License is to make a manual, textbook, or other
-functional and useful document <em>free</em> in the sense of freedom: to
+functional and useful document <em class="dfn">free</em> in the sense of
freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
@@ -2665,7 +2770,7 @@
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
</p>
-<ol type="A" start="1">
+<ol class="enumerate" type="A" start="1">
<li> Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
@@ -2865,7 +2970,7 @@
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
-<a href="https://www.gnu.org/licenses/";>https://www.gnu.org/licenses/</a>.
+<a class="uref"
href="https://www.gnu.org/licenses/";>https://www.gnu.org/licenses/</a>.
</p>
<p>Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
@@ -2911,30 +3016,30 @@
</p>
</li></ol>
-<span id="ADDENDUM_003a-How-to-use-this-License-for-your-documents"></span><h3
class="heading">ADDENDUM: How to use this License for your documents</h3>
+<h3 class="heading"
id="ADDENDUM_003a-How-to-use-this-License-for-your-documents"><span>ADDENDUM:
How to use this License for your documents<a class="copiable-link"
href="#ADDENDUM_003a-How-to-use-this-License-for-your-documents">
¶</a></span></h3>
<p>To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
</p>
-<div class="example">
-<pre class="example"> Copyright (C) <var>year</var> <var>your name</var>.
+<div class="example smallexample">
+<div class="group"><pre class="example-preformatted"> Copyright (C) <var
class="var">year</var> <var class="var">your name</var>.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
-</pre></div>
+</pre></div></div>
<p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the “with…Texts.” line with this:
</p>
-<div class="example">
-<pre class="example"> with the Invariant Sections being <var>list their
titles</var>, with
- the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts
- being <var>list</var>.
-</pre></div>
+<div class="example smallexample">
+<div class="group"><pre class="example-preformatted"> with the Invariant
Sections being <var class="var">list their titles</var>, with
+ the Front-Cover Texts being <var class="var">list</var>, and with the
Back-Cover Texts
+ being <var class="var">list</var>.
+</pre></div></div>
<p>If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
@@ -2950,478 +3055,473 @@
<hr>
</div>
</div>
-<div class="unnumbered" id="Index">
-<div class="header">
+<div class="unnumbered-level-extent" id="Index">
+<div class="nav-panel">
<p>
Previous: <a href="#Copying" accesskey="p" rel="prev">Copying</a>, Up: <a
href="#Top" accesskey="u" rel="up">grep</a> [<a href="#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a href="#Index"
title="Index" rel="index">Index</a>]</p>
</div>
-<span id="Index-1"></span><h2 class="unnumbered">Index</h2>
+<h2 class="unnumbered" id="Index-1"><span>Index<a class="copiable-link"
href="#Index-1"> ¶</a></span></h2>
-<table><tr><th valign="top">Jump to: </th><td><a class="summary-letter"
href="#Index_cp_symbol-1"><b>*</b></a>
+<div class="printindex cp-printindex">
+<table class="cp-letters-header-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#Index_cp_symbol-1"><b>-</b></a>
-<a class="summary-letter" href="#Index_cp_symbol-2"><b>+</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_symbol-2"><b>?</b></a>
-<a class="summary-letter" href="#Index_cp_symbol-3"><b>-</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_symbol-3"><b>.</b></a>
-<a class="summary-letter" href="#Index_cp_symbol-4"><b>.</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_symbol-4"><b>{</b></a>
-<a class="summary-letter" href="#Index_cp_symbol-5"><b>?</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_symbol-5"><b>*</b></a>
-<a class="summary-letter" href="#Index_cp_symbol-6"><b>_</b></a>
-
-<a class="summary-letter" href="#Index_cp_symbol-7"><b>{</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_symbol-6"><b>+</b></a>
<br>
-<a class="summary-letter" href="#Index_cp_letter-A"><b>A</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-A"><b>A</b></a>
-<a class="summary-letter" href="#Index_cp_letter-B"><b>B</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-B"><b>B</b></a>
-<a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-C"><b>C</b></a>
-<a class="summary-letter" href="#Index_cp_letter-D"><b>D</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-D"><b>D</b></a>
-<a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-E"><b>E</b></a>
-<a class="summary-letter" href="#Index_cp_letter-F"><b>F</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-F"><b>F</b></a>
-<a class="summary-letter" href="#Index_cp_letter-G"><b>G</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-G"><b>G</b></a>
-<a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-H"><b>H</b></a>
-<a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-I"><b>I</b></a>
-<a class="summary-letter" href="#Index_cp_letter-L"><b>L</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-L"><b>L</b></a>
-<a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-M"><b>M</b></a>
-<a class="summary-letter" href="#Index_cp_letter-N"><b>N</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-N"><b>N</b></a>
-<a class="summary-letter" href="#Index_cp_letter-O"><b>O</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-O"><b>O</b></a>
-<a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-P"><b>P</b></a>
-<a class="summary-letter" href="#Index_cp_letter-Q"><b>Q</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-Q"><b>Q</b></a>
-<a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-R"><b>R</b></a>
-<a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-S"><b>S</b></a>
-<a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-T"><b>T</b></a>
-<a class="summary-letter" href="#Index_cp_letter-U"><b>U</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-U"><b>U</b></a>
-<a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-V"><b>V</b></a>
-<a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-W"><b>W</b></a>
-<a class="summary-letter" href="#Index_cp_letter-X"><b>X</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-X"><b>X</b></a>
-<a class="summary-letter" href="#Index_cp_letter-Z"><b>Z</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-Z"><b>Z</b></a>
</td></tr></table>
-<table class="index-cp" border="0">
-<tr><td></td><th align="left">Index Entry</th><td> </td><th align="left">
Section</th></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_symbol-1">*</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002a"><code>*</code></a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_symbol-2">+</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002b"><code>+</code></a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_symbol-3">-</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002d"><code>--</code></a>:</td><td> </td><td
valign="top"><a href="#Other-Options">Other Options</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dafter_002dcontext"><code>--after-context</code></a>:</td><td> </td><td
valign="top"><a href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dbasic_002dregexp"><code>--basic-regexp</code></a>:</td><td> </td><td
valign="top"><a href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dbefore_002dcontext"><code>--before-context</code></a>:</td><td> </td><td
valign="top"><a href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dbinary"><code>--binary</code></a>:</td><td> </td><td
valign="top"><a href="#Other-Options">Other Options</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dbinary_002dfiles"><code>--binary-files</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dbyte_002doffset"><code>--byte-offset</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dcolor"><code>--color</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dcolour"><code>--colour</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dcontext"><code>--context</code></a>:</td><td> </td><td
valign="top"><a href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dcount"><code>--count</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002ddereference_002drecursive"><code>--dereference-recursive</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002ddevices"><code>--devices</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002ddirectories"><code>--directories</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dexclude"><code>--exclude</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dexclude_002ddir"><code>--exclude-dir</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dexclude_002dfrom"><code>--exclude-from</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dextended_002dregexp"><code>--extended-regexp</code></a>:</td><td> </td><td
valign="top"><a href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dfile"><code>--file</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dfiles_002dwith_002dmatches"><code>--files-with-matches</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dfiles_002dwithout_002dmatch"><code>--files-without-match</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dfixed_002dstrings"><code>--fixed-strings</code></a>:</td><td> </td><td
valign="top"><a href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dgroup_002dseparator"><code>--group-separator</code></a>:</td><td> </td><td
valign="top"><a href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dgroup_002dseparator-1"><code>--group-separator</code></a>:</td><td> </td><td
valign="top"><a href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dhelp"><code>--help</code></a>:</td><td> </td><td
valign="top"><a href="#Generic-Program-Information">Generic Program
Information</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dignore_002dcase"><code>--ignore-case</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dinclude"><code>--include</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dinitial_002dtab"><code>--initial-tab</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dinvert_002dmatch"><code>--invert-match</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dlabel"><code>--label</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dline_002dbuffered"><code>--line-buffered</code></a>:</td><td> </td><td
valign="top"><a href="#Other-Options">Other Options</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dline_002dnumber"><code>--line-number</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dline_002dregexp"><code>--line-regexp</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dmax_002dcount"><code>--max-count</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dno_002dfilename"><code>--no-filename</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dno_002dignore_002dcase"><code>--no-ignore-case</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dno_002dmessages"><code>--no-messages</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dnull"><code>--null</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dnull_002ddata"><code>--null-data</code></a>:</td><td> </td><td
valign="top"><a href="#Other-Options">Other Options</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002donly_002dmatching"><code>--only-matching</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dperl_002dregexp"><code>--perl-regexp</code></a>:</td><td> </td><td
valign="top"><a href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dquiet"><code>--quiet</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002drecursive"><code>--recursive</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dregexp_003dpatterns"><code>--regexp=<var>patterns</var></code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dsilent"><code>--silent</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dtext"><code>--text</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dversion"><code>--version</code></a>:</td><td> </td><td
valign="top"><a href="#Generic-Program-Information">Generic Program
Information</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dwith_002dfilename"><code>--with-filename</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002d_002dword_002dregexp"><code>--word-regexp</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dA"><code>-A</code></a>:</td><td> </td><td
valign="top"><a href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002da"><code>-a</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002db"><code>-b</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dB"><code>-B</code></a>:</td><td> </td><td
valign="top"><a href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dc"><code>-c</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dC"><code>-C</code></a>:</td><td> </td><td
valign="top"><a href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dD"><code>-D</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dd"><code>-d</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002de"><code>-e</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dE"><code>-E</code></a>:</td><td> </td><td
valign="top"><a href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002df"><code>-f</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dF"><code>-F</code></a>:</td><td> </td><td
valign="top"><a href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dG"><code>-G</code></a>:</td><td> </td><td
valign="top"><a href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dH"><code>-H</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dh"><code>-h</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002di"><code>-i</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dL"><code>-L</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dl"><code>-l</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dm"><code>-m</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dn"><code>-n</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dnum"><code>-<var>num</var></code></a>:</td><td> </td><td
valign="top"><a href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002do"><code>-o</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dP"><code>-P</code></a>:</td><td> </td><td
valign="top"><a href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dq"><code>-q</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dr"><code>-r</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dR"><code>-R</code></a>:</td><td> </td><td
valign="top"><a href="#File-and-Directory-Selection">File and Directory
Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002ds"><code>-s</code></a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dT"><code>-T</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dU"><code>-U</code></a>:</td><td> </td><td
valign="top"><a href="#Other-Options">Other Options</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dV"><code>-V</code></a>:</td><td> </td><td
valign="top"><a href="#Generic-Program-Information">Generic Program
Information</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dv"><code>-v</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dw"><code>-w</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dx"><code>-x</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dy"><code>-y</code></a>:</td><td> </td><td
valign="top"><a href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dZ"><code>-Z</code></a>:</td><td> </td><td
valign="top"><a href="#Output-Line-Prefix-Control">Output Line Prefix
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002dz"><code>-z</code></a>:</td><td> </td><td
valign="top"><a href="#Other-Options">Other Options</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_symbol-4">.</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_002e"><code>.</code></a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_symbol-5">?</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_003f"><code>?</code></a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_symbol-6">_</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_005fN_005fGNU_005fnonoption_005fargv_005fflags_005f-environment-variable"><code>_<var>N</var>_GNU_nonoption_argv_flags_
<span class="roman">environment
variable</span></code></a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_symbol-7">{</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_007b_002cm_007d"><code>{,<var>m</var>}</code></a>:</td><td> </td><td
valign="top"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_007bn_002cm_007d"><code>{<var>n</var>,<var>m</var>}</code></a>:</td><td> </td><td
valign="top"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_007bn_002c_007d"><code>{<var>n</var>,}</code></a>:</td><td> </td><td
valign="top"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-_007bn_007d"><code>{<var>n</var>}</code></a>:</td><td> </td><td
valign="top"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-A">A</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-after-context">after
context</a>:</td><td> </td><td valign="top"><a
href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-alnum-character-class"><code>alnum <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-alpha-character-class"><code>alpha <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-alphabetic-characters">alphabetic
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-alphanumeric-characters">alphanumeric
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-alternatives-in-regular-expressions">alternatives in regular
expressions</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-anchoring">anchoring</a>:</td><td> </td><td valign="top"><a
href="#Anchoring">Anchoring</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-asterisk">asterisk</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-B">B</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-back_002dreference">back-reference</a>:</td><td> </td><td
valign="top"><a href="#Back_002dreferences-and-Subexpressions">Back-references
and Subexpressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-back_002dreferences">back-references</a>:</td><td> </td><td
valign="top"><a href="#Performance">Performance</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-backslash">backslash</a>:</td><td> </td><td valign="top"><a
href="#Special-Backslash-Expressions">Special Backslash
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-basic-regular-expressions">basic
regular expressions</a>:</td><td> </td><td valign="top"><a
href="#Basic-vs-Extended">Basic vs Extended</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-before-context">before
context</a>:</td><td> </td><td valign="top"><a
href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-binary-files">binary
files</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-binary-files-1">binary
files</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-binary-I_002fO">binary
I/O</a>:</td><td> </td><td valign="top"><a href="#Other-Options">Other
Options</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-blank-character-class"><code>blank <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-blank-characters">blank
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-bn-GREP_005fCOLORS-capability"><code>bn GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-braces_002c-first-argument-omitted">braces, first argument
omitted</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-braces_002c-one-argument">braces, one
argument</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-braces_002c-second-argument-omitted">braces, second argument
omitted</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-braces_002c-two-arguments">braces, two
arguments</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-bracket-expression">bracket
expression</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-Bugs_002c-known">Bugs,
known</a>:</td><td> </td><td valign="top"><a href="#Known-Bugs">Known
Bugs</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-bugs_002c-reporting">bugs,
reporting</a>:</td><td> </td><td valign="top"><a
href="#Reporting-Bugs">Reporting Bugs</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-byte-offset">byte
offset</a>:</td><td> </td><td valign="top"><a
href="#Output-Line-Prefix-Control">Output Line Prefix Control</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-C">C</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-case-insensitive-search">case
insensitive search</a>:</td><td> </td><td valign="top"><a
href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-case-insensitive-search-1">case
insensitive search</a>:</td><td> </td><td valign="top"><a
href="#Performance">Performance</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-changing-name-of-standard-input">changing name of standard
input</a>:</td><td> </td><td valign="top"><a
href="#Output-Line-Prefix-Control">Output Line Prefix Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-character-class">character
class</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-character-classes">character
classes</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-character-encoding">character
encoding</a>:</td><td> </td><td valign="top"><a
href="#Character-Encoding">Character Encoding</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-character-type">character
type</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-classes-of-characters">classes
of characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-cntrl-character-class"><code>cntrl <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-context-lines">context
lines</a>:</td><td> </td><td valign="top"><a
href="#General-Output-Control">General Output Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-context-lines-1">context
lines</a>:</td><td> </td><td valign="top"><a
href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-context-lines-2">context
lines</a>:</td><td> </td><td valign="top"><a
href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-context-lines_002c-after-match">context lines, after
match</a>:</td><td> </td><td valign="top"><a
href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-context-lines_002c-before-match">context lines, before
match</a>:</td><td> </td><td valign="top"><a
href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-control-characters">control
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-copying">copying</a>:</td><td> </td><td valign="top"><a
href="#Copying">Copying</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-counting-lines">counting
lines</a>:</td><td> </td><td valign="top"><a
href="#General-Output-Control">General Output Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-cx-GREP_005fCOLORS-capability"><code>cx GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-D">D</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-device-search">device
search</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-digit-character-class"><code>digit <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-digit-characters">digit
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-directory-search">directory
search</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-dot">dot</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-E">E</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-encoding-error">encoding
error</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-environment-variables">environment
variables</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-exclude-directories">exclude
directories</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-exclude-files">exclude
files</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-exclude-files-1">exclude
files</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-exit-status">exit
status</a>:</td><td> </td><td valign="top"><a href="#Exit-Status">Exit
Status</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-F">F</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-FAQ-about-grep-usage">FAQ about
<code>grep</code> usage</a>:</td><td> </td><td valign="top"><a
href="#Usage">Usage</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-files-which-don_0027t-match">files which don’t
match</a>:</td><td> </td><td valign="top"><a
href="#General-Output-Control">General Output Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-fn-GREP_005fCOLORS-capability"><code>fn GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-fn-GREP_005fCOLORS-capability-1"><code>fn GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-G">G</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-graph-character-class"><code>graph <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-graphic-characters">graphic
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-grep-programs"><code>grep</code>
programs</a>:</td><td> </td><td valign="top"><a href="#grep-Programs">grep
Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-GREP_005fCOLOR-environment-variable"><code>GREP_COLOR <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-GREP_005fCOLORS-environment-variable"><code>GREP_COLORS <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-group-separator">group
separator</a>:</td><td> </td><td valign="top"><a
href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-group-separator-1">group
separator</a>:</td><td> </td><td valign="top"><a
href="#Context-Line-Control">Context Line Control</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-H">H</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-hexadecimal-digits">hexadecimal
digits</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-highlight-markers">highlight
markers</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-highlight-markers-1">highlight
markers</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-highlight_002c-color_002c-colour">highlight, color,
colour</a>:</td><td> </td><td valign="top"><a
href="#General-Output-Control">General Output Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-holes-in-files">holes in
files</a>:</td><td> </td><td valign="top"><a
href="#Performance">Performance</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-I">I</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-include-files">include
files</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-interval-expressions">interval
expressions</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-interval-expressions-1">interval
expressions</a>:</td><td> </td><td valign="top"><a
href="#Performance">Performance</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-invalid-regular-expressions">invalid regular
expressions</a>:</td><td> </td><td valign="top"><a
href="#Problematic-Expressions">Problematic Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-invert-matching">invert
matching</a>:</td><td> </td><td valign="top"><a
href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-L">L</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LANG-environment-variable"><code>LANG <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LANG-environment-variable-1"><code>LANG <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LANG-environment-variable-2"><code>LANG <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LANG-environment-variable-3"><code>LANG <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LANGUAGE-environment-variable"><code>LANGUAGE <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LANGUAGE-environment-variable-1"><code>LANGUAGE <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-language-of-messages">language
of messages</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LC_005fALL-environment-variable"><code>LC_ALL <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LC_005fALL-environment-variable-1"><code>LC_ALL <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LC_005fALL-environment-variable-2"><code>LC_ALL <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LC_005fALL-environment-variable-3"><code>LC_ALL <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LC_005fCOLLATE-environment-variable"><code>LC_COLLATE <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LC_005fCTYPE-environment-variable"><code>LC_CTYPE <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LC_005fMESSAGES-environment-variable"><code>LC_MESSAGES <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-LC_005fMESSAGES-environment-variable-1"><code>LC_MESSAGES <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-line-buffering">line
buffering</a>:</td><td> </td><td valign="top"><a
href="#Other-Options">Other Options</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-line-numbering">line
numbering</a>:</td><td> </td><td valign="top"><a
href="#Output-Line-Prefix-Control">Output Line Prefix Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-ln-GREP_005fCOLORS-capability"><code>ln GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-locales">locales</a>:</td><td> </td><td valign="top"><a
href="#Performance">Performance</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-lower-character-class"><code>lower <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-lower_002dcase-letters">lower-case
letters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-M">M</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-match-expression-at-most-m-times">match expression at most
<var>m</var> times</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-match-expression-at-most-once">match expression at most
once</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-match-expression-from-n-to-m-times">match expression from
<var>n</var> to <var>m</var> times</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-match-expression-n-or-more-times">match expression <var>n</var> or
more times</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-match-expression-n-times">match
expression <var>n</var> times</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-match-expression-one-or-more-times">match expression one or more
times</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-match-expression-zero-or-more-times">match expression zero or more
times</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-match-the-whole-line">match the
whole line</a>:</td><td> </td><td valign="top"><a
href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-matching-basic-regular-expressions">matching basic regular
expressions</a>:</td><td> </td><td valign="top"><a
href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-matching-extended-regular-expressions">matching extended regular
expressions</a>:</td><td> </td><td valign="top"><a
href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-matching-fixed-strings">matching
fixed strings</a>:</td><td> </td><td valign="top"><a
href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-matching-Perl_002dcompatible-regular-expressions">matching
Perl-compatible regular expressions</a>:</td><td> </td><td valign="top"><a
href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-matching-whole-words">matching
whole words</a>:</td><td> </td><td valign="top"><a
href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-max_002dcount">max-count</a>:</td><td> </td><td
valign="top"><a href="#General-Output-Control">General Output
Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-mc-GREP_005fCOLORS-capability"><code>mc GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-message-language">message
language</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-ms-GREP_005fCOLORS-capability"><code>ms GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-MS_002dWindows-binary-I_002fO">MS-Windows binary
I/O</a>:</td><td> </td><td valign="top"><a href="#Other-Options">Other
Options</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-mt-GREP_005fCOLORS-capability"><code>mt GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-N">N</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-names-of-matching-files">names
of matching files</a>:</td><td> </td><td valign="top"><a
href="#General-Output-Control">General Output Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-national-language-support">national language
support</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-national-language-support-1">national language
support</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-ne-GREP_005fCOLORS-capability"><code>ne GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-NLS">NLS</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-no-filename-prefix">no filename
prefix</a>:</td><td> </td><td valign="top"><a
href="#Output-Line-Prefix-Control">Output Line Prefix Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-non_002dASCII-matching">non-ASCII
matching</a>:</td><td> </td><td valign="top"><a
href="#Matching-Non_002dASCII">Matching Non-ASCII</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-non_002dprintable-matching">non-printable
matching</a>:</td><td> </td><td valign="top"><a
href="#Matching-Non_002dASCII">Matching Non-ASCII</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-null-character">null
character</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-numeric-characters">numeric
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-O">O</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-only-matching">only
matching</a>:</td><td> </td><td valign="top"><a
href="#General-Output-Control">General Output Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-option-delimiter">option
delimiter</a>:</td><td> </td><td valign="top"><a
href="#Other-Options">Other Options</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-ordinary-characters">ordinary
characters</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-P">P</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-patterns-from-file">patterns
from file</a>:</td><td> </td><td valign="top"><a
href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-patterns-option">patterns
option</a>:</td><td> </td><td valign="top"><a
href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-performance">performance</a>:</td><td> </td><td
valign="top"><a href="#Performance">Performance</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-period">period</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-pipelines-and-reading">pipelines
and reading</a>:</td><td> </td><td valign="top"><a
href="#Performance">Performance</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-plus-sign">plus
sign</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-POSIXLY_005fCORRECT-environment-variable"><code>POSIXLY_CORRECT
<span class="roman">environment
variable</span></code></a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-print-character-class"><code>print <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-print-non_002dmatching-lines">print non-matching
lines</a>:</td><td> </td><td valign="top"><a
href="#Matching-Control">Matching Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-printable-characters">printable
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-punct-character-class"><code>punct <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-punctuation-characters">punctuation
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-Q">Q</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-question-mark">question
mark</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-quiet_002c-silent">quiet,
silent</a>:</td><td> </td><td valign="top"><a
href="#General-Output-Control">General Output Control</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-R">R</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-range-expression">range
expression</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-recursive-search">recursive
search</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-recursive-search-1">recursive
search</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-regular-expressions">regular
expressions</a>:</td><td> </td><td valign="top"><a
href="#Regular-Expressions">Regular Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-return-status">return
status</a>:</td><td> </td><td valign="top"><a href="#Exit-Status">Exit
Status</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-rv-GREP_005fCOLORS-capability"><code>rv GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-S">S</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-searching-directory-trees">searching directory
trees</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-searching-directory-trees-1">searching directory
trees</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-searching-directory-trees-2">searching directory
trees</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-searching-directory-trees-3">searching directory
trees</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-searching-directory-trees-4">searching directory
trees</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-searching-for-patterns">searching for
patterns</a>:</td><td> </td><td valign="top"><a
href="#Introduction">Introduction</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-sl-GREP_005fCOLORS-capability"><code>sl GREP_COLORS <span
class="roman">capability</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-space-character-class"><code>space <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-space-characters">space
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-special-characters">special
characters</a>:</td><td> </td><td valign="top"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-subexpression">subexpression</a>:</td><td> </td><td
valign="top"><a href="#Back_002dreferences-and-Subexpressions">Back-references
and Subexpressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-suppress-binary-data">suppress
binary data</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-suppress-error-messages">suppress error
messages</a>:</td><td> </td><td valign="top"><a
href="#General-Output-Control">General Output Control</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-symbolic-links">symbolic
links</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-symbolic-links-1">symbolic
links</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-symbolic-links-2">symbolic
links</a>:</td><td> </td><td valign="top"><a
href="#File-and-Directory-Selection">File and Directory Selection</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-T">T</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-tab_002daligned-content-lines">tab-aligned content
lines</a>:</td><td> </td><td valign="top"><a
href="#Output-Line-Prefix-Control">Output Line Prefix Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-TERM-environment-variable"><code>TERM <span
class="roman">environment variable</span></code></a>:</td><td> </td><td
valign="top"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-translation-of-message-language">translation of message
language</a>:</td><td> </td><td valign="top"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-U">U</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-unspecified-behavior-in-regular-expressions">unspecified behavior
in regular expressions</a>:</td><td> </td><td valign="top"><a
href="#Problematic-Expressions">Problematic Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-upper-character-class"><code>upper <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-upper_002dcase-letters">upper-case
letters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-usage-summary_002c-printing">usage summary,
printing</a>:</td><td> </td><td valign="top"><a
href="#Generic-Program-Information">Generic Program Information</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-usage_002c-examples">usage,
examples</a>:</td><td> </td><td valign="top"><a
href="#Usage">Usage</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-using-grep_002c-Q_0026A">using
<code>grep</code>, Q&A</a>:</td><td> </td><td valign="top"><a
href="#Usage">Usage</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-V">V</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a href="#index-variants-of-grep">variants of
<code>grep</code></a>:</td><td> </td><td valign="top"><a
href="#grep-Programs">grep Programs</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-version_002c-printing">version,
printing</a>:</td><td> </td><td valign="top"><a
href="#Generic-Program-Information">Generic Program Information</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-W">W</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-whitespace-characters">whitespace
characters</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-with-filename-prefix">with
filename prefix</a>:</td><td> </td><td valign="top"><a
href="#Output-Line-Prefix-Control">Output Line Prefix Control</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-X">X</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-xdigit-character-class"><code>xdigit <span class="roman">character
class</span></code></a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td></td><td valign="top"><a href="#index-xdigit-class">xdigit
class</a>:</td><td> </td><td valign="top"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
-<tr><th id="Index_cp_letter-Z">Z</th><td></td><td></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-zero_002dterminated-file-names">zero-terminated file
names</a>:</td><td> </td><td valign="top"><a
href="#Output-Line-Prefix-Control">Output Line Prefix Control</a></td></tr>
-<tr><td></td><td valign="top"><a
href="#index-zero_002dterminated-lines">zero-terminated
lines</a>:</td><td> </td><td valign="top"><a href="#Other-Options">Other
Options</a></td></tr>
-<tr><td colspan="4"> <hr></td></tr>
+<table class="cp-entries-printindex" border="0">
+<tr><td></td><th class="entries-header-printindex">Index Entry</th><th
class="sections-header-printindex">Section</th></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_symbol-1">-</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002d"><code>--</code></a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dafter_002dcontext"><code>--after-context</code></a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dbasic_002dregexp"><code>--basic-regexp</code></a></td><td
class="printindex-index-section"><a href="#grep-Programs">grep
Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dbefore_002dcontext"><code>--before-context</code></a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dbinary"><code>--binary</code></a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dbinary_002dfiles"><code>--binary-files</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dbyte_002doffset"><code>--byte-offset</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dcolor"><code>--color</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dcolour"><code>--colour</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dcontext"><code>--context</code></a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dcount"><code>--count</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002ddereference_002drecursive"><code>--dereference-recursive</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002ddevices"><code>--devices</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002ddirectories"><code>--directories</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dexclude"><code>--exclude</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dexclude_002ddir"><code>--exclude-dir</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dexclude_002dfrom"><code>--exclude-from</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dextended_002dregexp"><code>--extended-regexp</code></a></td><td
class="printindex-index-section"><a href="#grep-Programs">grep
Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dfile"><code>--file</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dfiles_002dwith_002dmatches"><code>--files-with-matches</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dfiles_002dwithout_002dmatch"><code>--files-without-match</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dfixed_002dstrings"><code>--fixed-strings</code></a></td><td
class="printindex-index-section"><a href="#grep-Programs">grep
Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dgroup_002dseparator"><code>--group-separator</code></a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dgroup_002dseparator-1"><code>--group-separator</code></a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dhelp"><code>--help</code></a></td><td
class="printindex-index-section"><a href="#Generic-Program-Information">Generic
Program Information</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dignore_002dcase"><code>--ignore-case</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dinclude"><code>--include</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dinitial_002dtab"><code>--initial-tab</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dinvert_002dmatch"><code>--invert-match</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dlabel"><code>--label</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dline_002dbuffered"><code>--line-buffered</code></a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dline_002dnumber"><code>--line-number</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dline_002dregexp"><code>--line-regexp</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dmax_002dcount"><code>--max-count</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dno_002dfilename"><code>--no-filename</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dno_002dignore_002dcase"><code>--no-ignore-case</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dno_002dmessages"><code>--no-messages</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dnull"><code>--null</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dnull_002ddata"><code>--null-data</code></a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002donly_002dmatching"><code>--only-matching</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dperl_002dregexp"><code>--perl-regexp</code></a></td><td
class="printindex-index-section"><a href="#grep-Programs">grep
Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dquiet"><code>--quiet</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002drecursive"><code>--recursive</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dregexp_003dpatterns"><code>--regexp=<var
class="var">patterns</var></code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dsilent"><code>--silent</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dtext"><code>--text</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dversion"><code>--version</code></a></td><td
class="printindex-index-section"><a href="#Generic-Program-Information">Generic
Program Information</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dwith_002dfilename"><code>--with-filename</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002d_002dword_002dregexp"><code>--word-regexp</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dA"><code>-A</code></a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002da"><code>-a</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002db"><code>-b</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dB"><code>-B</code></a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dc"><code>-c</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dC"><code>-C</code></a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dD"><code>-D</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dd"><code>-d</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002de"><code>-e</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dE"><code>-E</code></a></td><td
class="printindex-index-section"><a href="#grep-Programs">grep
Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002df"><code>-f</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dF"><code>-F</code></a></td><td
class="printindex-index-section"><a href="#grep-Programs">grep
Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dG"><code>-G</code></a></td><td
class="printindex-index-section"><a href="#grep-Programs">grep
Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dH"><code>-H</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dh"><code>-h</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002di"><code>-i</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dL"><code>-L</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dl"><code>-l</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dm"><code>-m</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dn"><code>-n</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dnum"><code>-<var class="var">num</var></code></a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002do"><code>-o</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dP"><code>-P</code></a></td><td
class="printindex-index-section"><a href="#grep-Programs">grep
Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dq"><code>-q</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dr"><code>-r</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dR"><code>-R</code></a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002ds"><code>-s</code></a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dT"><code>-T</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dU"><code>-U</code></a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dV"><code>-V</code></a></td><td
class="printindex-index-section"><a href="#Generic-Program-Information">Generic
Program Information</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dv"><code>-v</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dw"><code>-w</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dx"><code>-x</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dy"><code>-y</code></a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dZ"><code>-Z</code></a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002dz"><code>-z</code></a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_symbol-2">?</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_003f"><code>?</code></a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_symbol-3">.</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002e"><code>.</code></a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_symbol-4">{</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_007b_002cm_007d"><code>{,<var
class="var">m</var>}</code></a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_007bn_002c_007d"><code>{<var
class="var">n</var>,}</code></a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_007bn_002cm_007d"><code>{<var class="var">n</var>,<var
class="var">m</var>}</code></a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_007bn_007d"><code>{<var class="var">n</var>}</code></a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_symbol-5">*</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002a"><code>*</code></a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_symbol-6">+</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-_002b"><code>+</code></a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-A">A</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-after-context">after context</a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-alnum-character-class"><code>alnum <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-alpha-character-class"><code>alpha <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-alphabetic-characters">alphabetic characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-alphanumeric-characters">alphanumeric characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-alternatives-in-regular-expressions">alternatives in regular
expressions</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-anchoring">anchoring</a></td><td
class="printindex-index-section"><a href="#Anchoring">Anchoring</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-asterisk">asterisk</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-B">B</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-back_002dreference">back-reference</a></td><td
class="printindex-index-section"><a
href="#Back_002dreferences-and-Subexpressions">Back-references and
Subexpressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-back_002dreferences">back-references</a></td><td
class="printindex-index-section"><a
href="#Performance">Performance</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-backslash">backslash</a></td><td
class="printindex-index-section"><a
href="#Special-Backslash-Expressions">Special Backslash
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-basic-regular-expressions">basic regular expressions</a></td><td
class="printindex-index-section"><a href="#Basic-vs-Extended">Basic vs
Extended</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-before-context">before context</a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-binary-files">binary files</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-binary-files-1">binary files</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-binary-I_002fO">binary I/O</a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-blank-character-class"><code>blank <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-blank-characters">blank characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-bn-GREP_005fCOLORS-capability"><code>bn GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-braces_002c-first-argument-omitted">braces, first argument
omitted</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-braces_002c-one-argument">braces, one argument</a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-braces_002c-second-argument-omitted">braces, second argument
omitted</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-braces_002c-two-arguments">braces, two arguments</a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-bracket-expression">bracket expression</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-Bugs_002c-known">Bugs, known</a></td><td
class="printindex-index-section"><a href="#Known-Bugs">Known Bugs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-bugs_002c-reporting">bugs, reporting</a></td><td
class="printindex-index-section"><a href="#Reporting-Bugs">Reporting
Bugs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-byte-offset">byte offset</a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-C">C</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-case-insensitive-search">case insensitive search</a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-case-insensitive-search-1">case insensitive search</a></td><td
class="printindex-index-section"><a
href="#Performance">Performance</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-changing-name-of-standard-input">changing name of standard
input</a></td><td class="printindex-index-section"><a
href="#Output-Line-Prefix-Control">Output Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-character-class">character class</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-character-classes">character classes</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-character-encoding">character encoding</a></td><td
class="printindex-index-section"><a href="#Character-Encoding">Character
Encoding</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-character-type">character type</a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-classes-of-characters">classes of characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-cntrl-character-class"><code>cntrl <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-context-lines">context lines</a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-context-lines-1">context lines</a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-context-lines-2">context lines</a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-context-lines_002c-after-match">context lines, after
match</a></td><td class="printindex-index-section"><a
href="#Context-Line-Control">Context Line Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-context-lines_002c-before-match">context lines, before
match</a></td><td class="printindex-index-section"><a
href="#Context-Line-Control">Context Line Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-control-characters">control characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-copying">copying</a></td><td class="printindex-index-section"><a
href="#Copying">Copying</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-counting-lines">counting lines</a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-cx-GREP_005fCOLORS-capability"><code>cx GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-D">D</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-device-search">device search</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-digit-character-class"><code>digit <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-digit-characters">digit characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-directory-search">directory search</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-dot">dot</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-E">E</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-encoding-error">encoding error</a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-environment-variables">environment variables</a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-exclude-directories">exclude directories</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-exclude-files">exclude files</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-exclude-files-1">exclude files</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-exit-status">exit status</a></td><td
class="printindex-index-section"><a href="#Exit-Status">Exit
Status</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-F">F</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-FAQ-about-grep-usage">FAQ about <code class="command">grep</code>
usage</a></td><td class="printindex-index-section"><a
href="#Usage">Usage</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-files-which-don_0027t-match">files which don’t
match</a></td><td class="printindex-index-section"><a
href="#General-Output-Control">General Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-fn-GREP_005fCOLORS-capability"><code>fn GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-fn-GREP_005fCOLORS-capability-1"><code>fn GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-G">G</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-graph-character-class"><code>graph <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-graphic-characters">graphic characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-grep-programs"><code class="command">grep</code>
programs</a></td><td class="printindex-index-section"><a
href="#grep-Programs">grep Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-GREP_005fCOLOR-environment-variable"><code>GREP_COLOR <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-GREP_005fCOLORS-environment-variable"><code>GREP_COLORS <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-group-separator">group separator</a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-group-separator-1">group separator</a></td><td
class="printindex-index-section"><a href="#Context-Line-Control">Context Line
Control</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-H">H</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-hexadecimal-digits">hexadecimal digits</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-highlight-markers">highlight markers</a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-highlight-markers-1">highlight markers</a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-highlight_002c-color_002c-colour">highlight, color,
colour</a></td><td class="printindex-index-section"><a
href="#General-Output-Control">General Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-holes-in-files">holes in files</a></td><td
class="printindex-index-section"><a
href="#Performance">Performance</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-I">I</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-include-files">include files</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-interval-expressions">interval expressions</a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-interval-expressions-1">interval expressions</a></td><td
class="printindex-index-section"><a
href="#Performance">Performance</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-invalid-regular-expressions">invalid regular
expressions</a></td><td class="printindex-index-section"><a
href="#Problematic-Expressions">Problematic Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-invert-matching">invert matching</a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-L">L</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LANG-environment-variable"><code>LANG <span class="r">environment
variable</span></code></a></td><td class="printindex-index-section"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LANG-environment-variable-1"><code>LANG <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LANG-environment-variable-2"><code>LANG <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LANG-environment-variable-3"><code>LANG <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LANGUAGE-environment-variable"><code>LANGUAGE <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LANGUAGE-environment-variable-1"><code>LANGUAGE <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-language-of-messages">language of messages</a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LC_005fALL-environment-variable"><code>LC_ALL <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LC_005fALL-environment-variable-1"><code>LC_ALL <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LC_005fALL-environment-variable-2"><code>LC_ALL <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LC_005fALL-environment-variable-3"><code>LC_ALL <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LC_005fCOLLATE-environment-variable"><code>LC_COLLATE <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LC_005fCTYPE-environment-variable"><code>LC_CTYPE <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LC_005fMESSAGES-environment-variable"><code>LC_MESSAGES <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-LC_005fMESSAGES-environment-variable-1"><code>LC_MESSAGES <span
class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-line-buffering">line buffering</a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-line-numbering">line numbering</a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-ln-GREP_005fCOLORS-capability"><code>ln GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-locales">locales</a></td><td class="printindex-index-section"><a
href="#Performance">Performance</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-lower-character-class"><code>lower <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-lower_002dcase-letters">lower-case letters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-M">M</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-match-expression-at-most-m-times">match expression at most <var
class="var">m</var> times</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-match-expression-at-most-once">match expression at most
once</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-match-expression-from-n-to-m-times">match expression from <var
class="var">n</var> to <var class="var">m</var> times</a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-match-expression-n-or-more-times">match expression <var
class="var">n</var> or more times</a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-match-expression-n-times">match expression <var
class="var">n</var> times</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-match-expression-one-or-more-times">match expression one or more
times</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-match-expression-zero-or-more-times">match expression zero or more
times</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-match-the-whole-line">match the whole line</a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-matching-basic-regular-expressions">matching basic regular
expressions</a></td><td class="printindex-index-section"><a
href="#grep-Programs">grep Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-matching-extended-regular-expressions">matching extended regular
expressions</a></td><td class="printindex-index-section"><a
href="#grep-Programs">grep Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-matching-fixed-strings">matching fixed strings</a></td><td
class="printindex-index-section"><a href="#grep-Programs">grep
Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-matching-Perl_002dcompatible-regular-expressions">matching
Perl-compatible regular expressions</a></td><td
class="printindex-index-section"><a href="#grep-Programs">grep
Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-matching-whole-words">matching whole words</a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-max_002dcount">max-count</a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-mc-GREP_005fCOLORS-capability"><code>mc GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-message-language">message language</a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-ms-GREP_005fCOLORS-capability"><code>ms GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-MS_002dWindows-binary-I_002fO">MS-Windows binary I/O</a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-mt-GREP_005fCOLORS-capability"><code>mt GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-N">N</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-names-of-matching-files">names of matching files</a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-national-language-support">national language support</a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-national-language-support-1">national language support</a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-ne-GREP_005fCOLORS-capability"><code>ne GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-NLS">NLS</a></td><td class="printindex-index-section"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-no-filename-prefix">no filename prefix</a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-non_002dASCII-matching">non-ASCII matching</a></td><td
class="printindex-index-section"><a href="#Matching-Non_002dASCII">Matching
Non-ASCII</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-non_002dprintable-matching">non-printable matching</a></td><td
class="printindex-index-section"><a href="#Matching-Non_002dASCII">Matching
Non-ASCII</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-null-character">null character</a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-numeric-characters">numeric characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-O">O</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-only-matching">only matching</a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-option-delimiter">option delimiter</a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-ordinary-characters">ordinary characters</a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-P">P</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-patterns-from-file">patterns from file</a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-patterns-option">patterns option</a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-performance">performance</a></td><td
class="printindex-index-section"><a
href="#Performance">Performance</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-period">period</a></td><td class="printindex-index-section"><a
href="#Fundamental-Structure">Fundamental Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-pipelines-and-reading">pipelines and reading</a></td><td
class="printindex-index-section"><a
href="#Performance">Performance</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-plus-sign">plus sign</a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-POSIXLY_005fCORRECT-environment-variable"><code>POSIXLY_CORRECT
<span class="r">environment variable</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-print-character-class"><code>print <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-print-non_002dmatching-lines">print non-matching lines</a></td><td
class="printindex-index-section"><a href="#Matching-Control">Matching
Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-printable-characters">printable characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-punct-character-class"><code>punct <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-punctuation-characters">punctuation characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-Q">Q</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-question-mark">question mark</a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-quiet_002c-silent">quiet, silent</a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-R">R</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-range-expression">range expression</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-recursive-search">recursive search</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-recursive-search-1">recursive search</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-regular-expressions">regular expressions</a></td><td
class="printindex-index-section"><a href="#Regular-Expressions">Regular
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-return-status">return status</a></td><td
class="printindex-index-section"><a href="#Exit-Status">Exit
Status</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-rv-GREP_005fCOLORS-capability"><code>rv GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-S">S</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-searching-directory-trees">searching directory trees</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-searching-directory-trees-1">searching directory trees</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-searching-directory-trees-2">searching directory trees</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-searching-directory-trees-3">searching directory trees</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-searching-directory-trees-4">searching directory trees</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-searching-for-patterns">searching for patterns</a></td><td
class="printindex-index-section"><a
href="#Introduction">Introduction</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-sl-GREP_005fCOLORS-capability"><code>sl GREP_COLORS <span
class="r">capability</span></code></a></td><td
class="printindex-index-section"><a href="#Environment-Variables">Environment
Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-space-character-class"><code>space <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-space-characters">space characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-special-characters">special characters</a></td><td
class="printindex-index-section"><a href="#Fundamental-Structure">Fundamental
Structure</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-subexpression">subexpression</a></td><td
class="printindex-index-section"><a
href="#Back_002dreferences-and-Subexpressions">Back-references and
Subexpressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-suppress-binary-data">suppress binary data</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-suppress-error-messages">suppress error messages</a></td><td
class="printindex-index-section"><a href="#General-Output-Control">General
Output Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-symbolic-links">symbolic links</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-symbolic-links-1">symbolic links</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-symbolic-links-2">symbolic links</a></td><td
class="printindex-index-section"><a href="#File-and-Directory-Selection">File
and Directory Selection</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-T">T</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-tab_002daligned-content-lines">tab-aligned content
lines</a></td><td class="printindex-index-section"><a
href="#Output-Line-Prefix-Control">Output Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-TERM-environment-variable"><code>TERM <span class="r">environment
variable</span></code></a></td><td class="printindex-index-section"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-translation-of-message-language">translation of message
language</a></td><td class="printindex-index-section"><a
href="#Environment-Variables">Environment Variables</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-U">U</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-unspecified-behavior-in-regular-expressions">unspecified behavior
in regular expressions</a></td><td class="printindex-index-section"><a
href="#Problematic-Expressions">Problematic Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-upper-character-class"><code>upper <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-upper_002dcase-letters">upper-case letters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-usage-summary_002c-printing">usage summary, printing</a></td><td
class="printindex-index-section"><a href="#Generic-Program-Information">Generic
Program Information</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-usage_002c-examples">usage, examples</a></td><td
class="printindex-index-section"><a href="#Usage">Usage</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-using-grep_002c-Q_0026A">using <code class="command">grep</code>,
Q&A</a></td><td class="printindex-index-section"><a
href="#Usage">Usage</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-V">V</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-variants-of-grep">variants of <code
class="command">grep</code></a></td><td class="printindex-index-section"><a
href="#grep-Programs">grep Programs</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-version_002c-printing">version, printing</a></td><td
class="printindex-index-section"><a href="#Generic-Program-Information">Generic
Program Information</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-W">W</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-whitespace-characters">whitespace characters</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-with-filename-prefix">with filename prefix</a></td><td
class="printindex-index-section"><a href="#Output-Line-Prefix-Control">Output
Line Prefix Control</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-X">X</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-xdigit-character-class"><code>xdigit <span class="r">character
class</span></code></a></td><td class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-xdigit-class">xdigit class</a></td><td
class="printindex-index-section"><a
href="#Character-Classes-and-Bracket-Expressions">Character Classes and Bracket
Expressions</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
+<tr><th id="Index_cp_letter-Z">Z</th></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-zero_002dterminated-file-names">zero-terminated file
names</a></td><td class="printindex-index-section"><a
href="#Output-Line-Prefix-Control">Output Line Prefix Control</a></td></tr>
+<tr><td></td><td class="printindex-index-entry"><a
href="#index-zero_002dterminated-lines">zero-terminated lines</a></td><td
class="printindex-index-section"><a href="#Other-Options">Other
Options</a></td></tr>
+<tr><td colspan="3"><hr></td></tr>
</table>
-<table><tr><th valign="top">Jump to: </th><td><a class="summary-letter"
href="#Index_cp_symbol-1"><b>*</b></a>
-
-<a class="summary-letter" href="#Index_cp_symbol-2"><b>+</b></a>
+<table class="cp-letters-footer-printindex"><tr><th>Jump to:
</th><td><a class="summary-letter-printindex"
href="#Index_cp_symbol-1"><b>-</b></a>
-<a class="summary-letter" href="#Index_cp_symbol-3"><b>-</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_symbol-2"><b>?</b></a>
-<a class="summary-letter" href="#Index_cp_symbol-4"><b>.</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_symbol-3"><b>.</b></a>
-<a class="summary-letter" href="#Index_cp_symbol-5"><b>?</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_symbol-4"><b>{</b></a>
-<a class="summary-letter" href="#Index_cp_symbol-6"><b>_</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_symbol-5"><b>*</b></a>
-<a class="summary-letter" href="#Index_cp_symbol-7"><b>{</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_symbol-6"><b>+</b></a>
<br>
-<a class="summary-letter" href="#Index_cp_letter-A"><b>A</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-A"><b>A</b></a>
-<a class="summary-letter" href="#Index_cp_letter-B"><b>B</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-B"><b>B</b></a>
-<a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-C"><b>C</b></a>
-<a class="summary-letter" href="#Index_cp_letter-D"><b>D</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-D"><b>D</b></a>
-<a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-E"><b>E</b></a>
-<a class="summary-letter" href="#Index_cp_letter-F"><b>F</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-F"><b>F</b></a>
-<a class="summary-letter" href="#Index_cp_letter-G"><b>G</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-G"><b>G</b></a>
-<a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-H"><b>H</b></a>
-<a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-I"><b>I</b></a>
-<a class="summary-letter" href="#Index_cp_letter-L"><b>L</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-L"><b>L</b></a>
-<a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-M"><b>M</b></a>
-<a class="summary-letter" href="#Index_cp_letter-N"><b>N</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-N"><b>N</b></a>
-<a class="summary-letter" href="#Index_cp_letter-O"><b>O</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-O"><b>O</b></a>
-<a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-P"><b>P</b></a>
-<a class="summary-letter" href="#Index_cp_letter-Q"><b>Q</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-Q"><b>Q</b></a>
-<a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-R"><b>R</b></a>
-<a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-S"><b>S</b></a>
-<a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-T"><b>T</b></a>
-<a class="summary-letter" href="#Index_cp_letter-U"><b>U</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-U"><b>U</b></a>
-<a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-V"><b>V</b></a>
-<a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-W"><b>W</b></a>
-<a class="summary-letter" href="#Index_cp_letter-X"><b>X</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-X"><b>X</b></a>
-<a class="summary-letter" href="#Index_cp_letter-Z"><b>Z</b></a>
+<a class="summary-letter-printindex" href="#Index_cp_letter-Z"><b>Z</b></a>
</td></tr></table>
+</div>
</div>
</div>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Changes to grep/manual/grep.html,v,
Jim Meyering <=