[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to grep/manual/html_node/File-and-Directory-Selection.html,v
From: |
Jim Meyering |
Subject: |
Changes to grep/manual/html_node/File-and-Directory-Selection.html,v |
Date: |
Fri, 05 Feb 2016 00:45:01 +0000 |
CVSROOT: /webcvs/grep
Module name: grep
Changes by: Jim Meyering <meyering> 16/02/05 00:44:53
Index: html_node/File-and-Directory-Selection.html
===================================================================
RCS file: /webcvs/grep/grep/manual/html_node/File-and-Directory-Selection.html,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- html_node/File-and-Directory-Selection.html 2 Nov 2015 02:54:33 -0000
1.21
+++ html_node/File-and-Directory-Selection.html 5 Feb 2016 00:44:51 -0000
1.22
@@ -1,142 +1,236 @@
-<html lang="en">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!-- This manual is for grep, a pattern matching engine.
+
+Copyright (C) 1999-2002, 2005, 2008-2016 Free Software Foundation,
+Inc.
+
+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, 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". -->
+<!-- Created by GNU Texinfo 6.0, http://www.gnu.org/software/texinfo/ -->
<head>
-<title>File and Directory Selection - GNU Grep 2.22</title>
+<title>GNU Grep 2.23: File and Directory Selection</title>
+
+<meta name="description" content="GNU Grep 2.23: File and Directory Selection">
+<meta name="keywords" content="GNU Grep 2.23: File and Directory Selection">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta name="description" content="GNU Grep 2.22">
-<meta name="generator" content="makeinfo 4.13">
-<link title="Top" rel="start" href="index.html#Top">
-<link rel="up" href="Command_002dline-Options.html#Command_002dline-Options"
title="Command-line Options">
-<link rel="prev" href="Context-Line-Control.html#Context-Line-Control"
title="Context Line Control">
-<link rel="next" href="Other-Options.html#Other-Options" title="Other Options">
-<link href="http://www.gnu.org/software/texinfo/" rel="generator-home"
title="Texinfo Homepage">
+<link href="index.html#Top" rel="start" title="Top">
+<link href="Index.html#Index" rel="index" title="Index">
+<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
+<link href="Command_002dline-Options.html#Command_002dline-Options" rel="up"
title="Command-line Options">
+<link href="Other-Options.html#Other-Options" rel="next" title="Other Options">
+<link href="Context-Line-Control.html#Context-Line-Control" rel="prev"
title="Context Line Control">
+<style type="text/css">
<!--
-This manual is for `grep', a pattern matching engine.
+a.summary-letter {text-decoration: none}
+blockquote.indentedblock {margin-right: 0em}
+blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
+blockquote.smallquotation {font-size: smaller}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+div.lisp {margin-left: 3.2em}
+div.smalldisplay {margin-left: 3.2em}
+div.smallexample {margin-left: 3.2em}
+div.smalllisp {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}
+pre.smalldisplay {font-family: inherit; font-size: smaller}
+pre.smallexample {font-size: smaller}
+pre.smallformat {font-family: inherit; font-size: smaller}
+pre.smalllisp {font-size: smaller}
+span.nocodebreak {white-space: nowrap}
+span.nolinebreak {white-space: nowrap}
+span.roman {font-family: serif; font-weight: normal}
+span.sansserif {font-family: sans-serif; font-weight: normal}
+ul.no-bullet {list-style: none}
+-->
+</style>
+<link rel="stylesheet" type="text/css" href="/software/gnulib/manual.css">
-Copyright (C) 1999-2002, 2005, 2008-2015 Free Software Foundation,
-Inc.
- 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, 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''.
- -->
-<meta http-equiv="Content-Style-Type" content="text/css">
-<style type="text/css"><!--
- pre.display { font-family:inherit }
- pre.format { font-family:inherit }
- pre.smalldisplay { font-family:inherit; font-size:smaller }
- pre.smallformat { font-family:inherit; font-size:smaller }
- pre.smallexample { font-size:smaller }
- pre.smalllisp { font-size:smaller }
- span.sc { font-variant:small-caps }
- span.roman { font-family:serif; font-weight:normal; }
- span.sansserif { font-family:sans-serif; font-weight:normal; }
---></style>
-<link rel="stylesheet" type="text/css" href="/software/gnulib/manual.css">
</head>
-<body>
-<div class="node">
+
+<body lang="en">
<a name="File-and-Directory-Selection"></a>
+<div class="header">
<p>
-Next: <a rel="next" accesskey="n"
href="Other-Options.html#Other-Options">Other Options</a>,
-Previous: <a rel="previous" accesskey="p"
href="Context-Line-Control.html#Context-Line-Control">Context Line Control</a>,
-Up: <a rel="up" accesskey="u"
href="Command_002dline-Options.html#Command_002dline-Options">Command-line
Options</a>
-<hr>
+Next: <a href="Other-Options.html#Other-Options" accesskey="n"
rel="next">Other Options</a>, Previous: <a
href="Context-Line-Control.html#Context-Line-Control" accesskey="p"
rel="prev">Context Line Control</a>, Up: <a
href="Command_002dline-Options.html#Command_002dline-Options" accesskey="u"
rel="up">Command-line Options</a> [<a href="index.html#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a
href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
-
+<hr>
+<a name="File-and-Directory-Selection-1"></a>
<h4 class="subsection">2.1.6 File and Directory Selection</h4>
- <dl>
-<dt><samp><span class="option">-a</span></samp><dt><samp><span
class="option">--text</span></samp><dd><a name="index-g_t_002da-92"></a><a
name="index-g_t_002d_002dtext-93"></a><a
name="index-suppress-binary-data-94"></a><a
name="index-binary-files-95"></a>Process a binary file as if it were text;
-this is equivalent to the ‘<samp><span
class="samp">--binary-files=text</span></samp>’ option.
-
- <br><dt><samp><span
class="option">--binary-files=</span><var>type</var></samp><dd><a
name="index-g_t_002d_002dbinary_002dfiles-96"></a><a
name="index-binary-files-97"></a>If a file's allocation metadata,
-or if its data read before a line is selected for output,
+<dl compact="compact">
+<dt><samp>-a</samp></dt>
+<dt><samp>--text</samp></dt>
+<dd><a name="index-_002da"></a>
+<a name="index-_002d_002dtext"></a>
+<a name="index-suppress-binary-data"></a>
+<a name="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.
+</p>
+</dd>
+<dt><samp>--binary-files=<var>type</var></samp></dt>
+<dd><a name="index-_002d_002dbinary_002dfiles"></a>
+<a name="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>.
-Non-text bytes indicate binary data; these are either data bytes
-improperly encoded for the current locale, or null bytes when the
-<samp><span class="option">-z</span></samp> (<samp><span
class="option">--null-data</span></samp>) option is not given (see <a
href="Other-Options.html#Other-Options">Other Options</a>).
-
- <p>By default, <var>type</var> is ‘<samp><span
class="samp">binary</span></samp>’,
-and <samp><span class="command">grep</span></samp> normally outputs either
-a one-line message saying that a binary file matches,
-or no message if there is no match.
-When processing binary data, <samp><span class="command">grep</span></samp>
may treat non-text bytes
-as line terminators; for example, the pattern ‘<samp><span
class="samp">.</span></samp>’ (period) might
+Non-text bytes indicate binary data; these are either output bytes that are
+improperly encoded for the current locale, or null input bytes when the
+<samp>-z</samp> (<samp>--null-data</samp>) option is not given (see <a
href="Other-Options.html#Other-Options">Other Options</a>).
+</p>
+<p>By default, <var>type</var> is ‘<samp>binary</samp>’, and when
<code>grep</code>
+discovers that a file is binary it suppresses any further output, and
+instead outputs either a one-line message saying that a binary file
+matches, or no message if there is no match.
+When processing binary data, <code>grep</code> may treat non-text bytes
+as line terminators; for example, the pattern ‘<samp>.</samp>’
(period) might
not match a null byte, as the null byte might be treated as a line
-terminator even without the <samp><span class="option">-z</span></samp>
(<samp><span class="option">--null-data</span></samp>) option.
-
- <p>If <var>type</var> is ‘<samp><span
class="samp">without-match</span></samp>’,
-<samp><span class="command">grep</span></samp> assumes that a binary file does
not match;
-this is equivalent to the <samp><span class="option">-I</span></samp> option.
-
- <p>If <var>type</var> is ‘<samp><span
class="samp">text</span></samp>’,
-<samp><span class="command">grep</span></samp> processes a binary file as if
it were text;
-this is equivalent to the <samp><span class="option">-a</span></samp> option.
-
- <p><em>Warning:</em> ‘<samp><span
class="samp">--binary-files=text</span></samp>’ might output binary
garbage,
+terminator even without the <samp>-z</samp> (<samp>--null-data</samp>) option.
+</p>
+<p>If <var>type</var> is ‘<samp>without-match</samp>’,
+when <code>grep</code> discovers that a file is binary
+it assumes that the rest of the file does not match;
+this is equivalent to the <samp>-I</samp> option.
+</p>
+<p>If <var>type</var> is ‘<samp>text</samp>’,
+<code>grep</code> processes a binary file as if it were text;
+this is equivalent to the <samp>-a</samp> option.
+</p>
+<p><em>Warning:</em> ‘<samp>--binary-files=text</samp>’ 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.
-
- <br><dt><samp><span class="option">-D
</span><var>action</var></samp><dt><samp><span
class="option">--devices=</span><var>action</var></samp><dd><a
name="index-g_t_002dD-98"></a><a name="index-g_t_002d_002ddevices-99"></a><a
name="index-device-search-100"></a>If an input file is a device, FIFO, or
socket, use <var>action</var> to process it.
-If <var>action</var> is ‘<samp><span
class="samp">read</span></samp>’,
+</p>
+</dd>
+<dt><samp>-D <var>action</var></samp></dt>
+<dt><samp>--devices=<var>action</var></samp></dt>
+<dd><a name="index-_002dD"></a>
+<a name="index-_002d_002ddevices"></a>
+<a name="index-device-search"></a>
+<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>’,
all devices are read just as if they were ordinary files.
-If <var>action</var> is ‘<samp><span
class="samp">skip</span></samp>’,
+If <var>action</var> is ‘<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><span class="option">-R</span></samp> (<samp><span
class="option">--dereference-recursive</span></samp>) option is used, and are
-skipped if they are encountered recursively and the <samp><span
class="option">-r</span></samp>
-(<samp><span class="option">--recursive</span></samp>) option is used.
+<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.
This option has no effect on a file that is read via standard input.
-
- <br><dt><samp><span class="option">-d
</span><var>action</var></samp><dt><samp><span
class="option">--directories=</span><var>action</var></samp><dd><a
name="index-g_t_002dd-101"></a><a
name="index-g_t_002d_002ddirectories-102"></a><a
name="index-directory-search-103"></a><a name="index-symbolic-links-104"></a>If
an input file is a directory, use <var>action</var> to process it.
-By default, <var>action</var> is ‘<samp><span
class="samp">read</span></samp>’,
+</p>
+</dd>
+<dt><samp>-d <var>action</var></samp></dt>
+<dt><samp>--directories=<var>action</var></samp></dt>
+<dd><a name="index-_002dd"></a>
+<a name="index-_002d_002ddirectories"></a>
+<a name="index-directory-search"></a>
+<a name="index-symbolic-links"></a>
+<p>If an input file is a directory, use <var>action</var> to process it.
+By default, <var>action</var> is ‘<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 <samp><span class="command">grep</span></samp>
+and will cause <code>grep</code>
to print error messages for every directory or silently skip them).
-If <var>action</var> is ‘<samp><span
class="samp">skip</span></samp>’, directories are silently skipped.
-If <var>action</var> is ‘<samp><span
class="samp">recurse</span></samp>’,
-<samp><span class="command">grep</span></samp> reads all files under each
directory, recursively,
+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,
following command-line symbolic links and skipping other symlinks;
-this is equivalent to the <samp><span class="option">-r</span></samp> option.
-
- <br><dt><samp><span
class="option">--exclude=</span><var>glob</var></samp><dd><a
name="index-g_t_002d_002dexclude-105"></a><a
name="index-exclude-files-106"></a><a
name="index-searching-directory-trees-107"></a>Skip files whose name matches
the pattern <var>glob</var>, using wildcard
-matching. When searching recursively, skip any subfile whose base
+this is equivalent to the <samp>-r</samp> option.
+</p>
+</dd>
+<dt><samp>--exclude=<var>glob</var></samp></dt>
+<dd><a name="index-_002d_002dexclude"></a>
+<a name="index-exclude-files"></a>
+<a name="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
+name, or any suffix starting after a ‘<samp>/</samp>’ and before a
+non-‘<samp>/</samp>’. When searching recursively, skip any
subfile whose base
name matches <var>glob</var>; the base name is the part after the last
-‘<samp><span class="samp">/</span></samp>’. A pattern can use
-‘<samp><span class="samp">*</span></samp>’, ‘<samp><span
class="samp">?</span></samp>’, and ‘<samp><span
class="samp">[</span></samp>’...‘<samp><span
class="samp">]</span></samp>’ as wildcards,
+‘<samp>/</samp>’. 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.
-
- <br><dt><samp><span
class="option">--exclude-from=</span><var>file</var></samp><dd><a
name="index-g_t_002d_002dexclude_002dfrom-108"></a><a
name="index-exclude-files-109"></a><a
name="index-searching-directory-trees-110"></a>Skip files whose name matches
any of the patterns
+</p>
+</dd>
+<dt><samp>--exclude-from=<var>file</var></samp></dt>
+<dd><a name="index-_002d_002dexclude_002dfrom"></a>
+<a name="index-exclude-files-1"></a>
+<a name="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><span class="option">--exclude</span></samp>).
-
- <br><dt><samp><span
class="option">--exclude-dir=</span><var>glob</var></samp><dd><a
name="index-g_t_002d_002dexclude_002ddir-111"></a><a
name="index-exclude-directories-112"></a>Skip any directory whose name 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>.
-
- <br><dt><samp><span class="option">-I</span></samp><dd>Process a binary
file as if it did not contain matching data;
-this is equivalent to the ‘<samp><span
class="samp">--binary-files=without-match</span></samp>’ option.
-
- <br><dt><samp><span
class="option">--include=</span><var>glob</var></samp><dd><a
name="index-g_t_002d_002dinclude-113"></a><a
name="index-include-files-114"></a><a
name="index-searching-directory-trees-115"></a>Search only files whose name
matches <var>glob</var>,
-using wildcard matching as described under <samp><span
class="option">--exclude</span></samp>.
-
- <br><dt><samp><span class="option">-r</span></samp><dt><samp><span
class="option">--recursive</span></samp><dd><a
name="index-g_t_002dr-116"></a><a
name="index-g_t_002d_002drecursive-117"></a><a
name="index-recursive-search-118"></a><a
name="index-searching-directory-trees-119"></a><a
name="index-symbolic-links-120"></a>For each directory operand,
+under <samp>--exclude</samp>).
+</p>
+</dd>
+<dt><samp>--exclude-dir=<var>glob</var></samp></dt>
+<dd><a name="index-_002d_002dexclude_002ddir"></a>
+<a name="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>.
+</p>
+</dd>
+<dt><samp>-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.
+</p>
+</dd>
+<dt><samp>--include=<var>glob</var></samp></dt>
+<dd><a name="index-_002d_002dinclude"></a>
+<a name="index-include-files"></a>
+<a name="index-searching-directory-trees-2"></a>
+<p>Search only files whose name matches <var>glob</var>,
+using wildcard matching as described under <samp>--exclude</samp>.
+</p>
+</dd>
+<dt><samp>-r</samp></dt>
+<dt><samp>--recursive</samp></dt>
+<dd><a name="index-_002dr"></a>
+<a name="index-_002d_002drecursive"></a>
+<a name="index-recursive-search"></a>
+<a name="index-searching-directory-trees-3"></a>
+<a name="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><span
class="samp">--directories=recurse</span></samp>’ option.
-
- <br><dt><samp><span class="option">-R</span></samp><dt><samp><span
class="option">--dereference-recursive</span></samp><dd><a
name="index-g_t_002dR-121"></a><a
name="index-g_t_002d_002ddereference_002drecursive-122"></a><a
name="index-recursive-search-123"></a><a
name="index-searching-directory-trees-124"></a><a
name="index-symbolic-links-125"></a>For each directory operand, read and
process all files in that
+This is the same as the ‘<samp>--directories=recurse</samp>’
option.
+</p>
+</dd>
+<dt><samp>-R</samp></dt>
+<dt><samp>--dereference-recursive</samp></dt>
+<dd><a name="index-_002dR"></a>
+<a name="index-_002d_002ddereference_002drecursive"></a>
+<a name="index-recursive-search-1"></a>
+<a name="index-searching-directory-trees-4"></a>
+<a name="index-symbolic-links-2"></a>
+<p>For each directory operand, read and process all files in that
directory, recursively, following all symbolic links.
-
+</p>
+</dd>
</dl>
- </body></html>
+<hr>
+<div class="header">
+<p>
+Next: <a href="Other-Options.html#Other-Options" accesskey="n"
rel="next">Other Options</a>, Previous: <a
href="Context-Line-Control.html#Context-Line-Control" accesskey="p"
rel="prev">Context Line Control</a>, Up: <a
href="Command_002dline-Options.html#Command_002dline-Options" accesskey="u"
rel="up">Command-line Options</a> [<a href="index.html#SEC_Contents"
title="Table of contents" rel="contents">Contents</a>][<a
href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
+</div>
+
+
+</body>
+</html>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Changes to grep/manual/html_node/File-and-Directory-Selection.html,v,
Jim Meyering <=