CVSROOT: /webcvs/grep Module name: grep Changes by: Jim Meyering <meyering> 21/08/14 16:46:41
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.31 retrieving revision 1.32 diff -u -b -r1.31 -r1.32 --- html_node/File-and-Directory-Selection.html 28 Sep 2020 03:36:49 -0000 1.31 +++ html_node/File-and-Directory-Selection.html 14 Aug 2021 20:46:40 -0000 1.32 @@ -1,8 +1,11 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> +<!-- Created by GNU Texinfo 6.8, 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-2020 Free Software Foundation, +Copyright (C) 1999-2002, 2005, 2008-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document @@ -11,84 +14,72 @@ 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.5, http://www.gnu.org/software/texinfo/ --> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<title>File and Directory Selection (GNU Grep 3.5)</title> +<title>File and Directory Selection (GNU Grep 3.7)</title> -<meta name="description" content="File and Directory Selection (GNU Grep 3.5)"> -<meta name="keywords" content="File and Directory Selection (GNU Grep 3.5)"> +<meta name="description" content="File and Directory Selection (GNU Grep 3.7)"> +<meta name="keywords" content="File and Directory Selection (GNU Grep 3.7)"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> -<link href="index.html#Top" rel="start" title="Top"> -<link href="Index.html#Index" rel="index" title="Index"> +<meta name="viewport" content="width=device-width,initial-scale=1"> + +<link href="index.html" rel="start" title="Top"> +<link href="Index.html" 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"> +<link href="Command_002dline-Options.html" rel="up" title="Command-line Options"> +<link href="Other-Options.html" rel="next" title="Other Options"> +<link href="Context-Line-Control.html" rel="prev" title="Context Line Control"> <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} -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.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} --> </style> -<link rel="stylesheet" type="text/css" href="/software/gnulib/manual.css"> +<link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css"> </head> <body lang="en"> -<a name="File-and-Directory-Selection"></a> +<div class="subsection" id="File-and-Directory-Selection"> <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> +Next: <a href="Other-Options.html" accesskey="n" rel="next">Other Options</a>, Previous: <a href="Context-Line-Control.html" accesskey="p" rel="prev">Context Line Control</a>, Up: <a href="Command_002dline-Options.html" 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" 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> +<span id="File-and-Directory-Selection-1"></span><h4 class="subsection">2.1.6 File and Directory Selection</h4> <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> +<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> <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> +<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> <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 output bytes that are -improperly encoded for the current locale (see <a href="Environment-Variables.html#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.html#Other-Options">Other Options</a>). +improperly encoded for the current locale (see <a href="Environment-Variables.html">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.html">Other Options</a>). </p> <p>By default, <var>type</var> is ‘<samp>binary</samp>’, and <code>grep</code> suppresses output after null input binary data is discovered, @@ -124,11 +115,10 @@ even if the matches are unsafe for direct display. </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> +<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>’, all devices are read just as if they were ordinary files. @@ -141,12 +131,11 @@ This option has no effect on a file that is read via standard input. </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> +<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>’, which means that directories are read just as if they were ordinary files @@ -160,10 +149,9 @@ 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> +<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> <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 a trailing part that starts with a non-slash character @@ -175,44 +163,44 @@ and <code>\</code> to quote a wildcard or backslash character literally. </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> +<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> <p>Skip files whose name matches any of the patterns read from <var>file</var> (using wildcard matching as described 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> +<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> <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> +<dt><span><samp>-I</samp></span></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> +<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><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> +<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> <p>For each directory operand, read and process all files in that directory, recursively. Follow symbolic links on the command line, but skip symlinks @@ -221,23 +209,23 @@ 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> +<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> <p>For each directory operand, read and process all files in that directory, recursively, following all symbolic links. </p> </dd> </dl> +</div> <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> +Next: <a href="Other-Options.html">Other Options</a>, Previous: <a href="Context-Line-Control.html">Context Line Control</a>, Up: <a href="Command_002dline-Options.html">Command-line Options</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p> </div>
