fgrep.1 (5376B)
1 .\" 2 .\" Sccsid @(#)fgrep.1 1.24 (gritter) 1/24/05 3 .\" Parts taken from grep(1), Unix 7th edition: 4 .\" Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 5 .\" 6 .\" Redistribution and use in source and binary forms, with or without 7 .\" modification, are permitted provided that the following conditions 8 .\" are met: 9 .\" Redistributions of source code and documentation must retain the 10 .\" above copyright notice, this list of conditions and the following 11 .\" disclaimer. 12 .\" Redistributions in binary form must reproduce the above copyright 13 .\" notice, this list of conditions and the following disclaimer in the 14 .\" documentation and/or other materials provided with the distribution. 15 .\" All advertising materials mentioning features or use of this software 16 .\" must display the following acknowledgement: 17 .\" This product includes software developed or owned by Caldera 18 .\" International, Inc. 19 .\" Neither the name of Caldera International, Inc. nor the names of 20 .\" other contributors may be used to endorse or promote products 21 .\" derived from this software without specific prior written permission. 22 .\" 23 .\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 24 .\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 25 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 .\" ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE 28 .\" LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 34 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 .TH FGREP 1 "1/24/05" "Heirloom Toolchest" "User Commands" 36 .SH NAME 37 fgrep \- search a file for a character string 38 .SH SYNOPSIS 39 .HP 40 .ad l 41 .nh 42 \fB/usr/5bin/fgrep\fR [\fB\-e\fI\ string_list\fR\ ...] 43 [\fB\-f\fI\ string_file\fR] [\fB\-bchilnrRvxz\fR] 44 [\fIstring_list\fR] [\fIfile\fR\ ...] 45 .HP 46 .ad l 47 .PD 0 48 \fB/usr/5bin/posix/fgrep\fR \fB\-e\fI\ string_list\fR\ ... 49 [\fB\-f\fI\ string_file\fR] [\fB\-c\fR|\fB\-l\fR] 50 [\fB\-bhinrRvxz\fR] [\fIfile\fR\ ...] 51 .HP 52 .ad l 53 \fB/usr/5bin/posix/fgrep\fR \fB\-f\fI\ string_file\fR 54 [\fB\-e\fI\ string_list\fR\ ...] [\fB\-c\fR|\fB\-l\fR] 55 [\fB\-bhinrRvxz\fR] [\fIfile\fR\ ...] 56 .HP 57 .ad l 58 \fB/usr/5bin/posix/fgrep\fR [\fB\-c\fR|\fB\-l\fR] [\fB\-bhinrRvxz\fR] 59 \fIstring_list\fR [\fIfile\fR\ ...] 60 .br 61 .PD 62 .ad b 63 .hy 1 64 .SH DESCRIPTION 65 The 66 .B fgrep 67 command searches the lines of the specified files 68 (or of standard input) 69 for occurrences of any of the newline separated strings in 70 .I string_list. 71 The default behavior is to print each matching line to standard output. 72 .PP 73 Both 74 .B /usr/5bin/fgrep 75 and 76 .B /usr/5bin/posix/fgrep 77 accept the following options: 78 .TP 79 .B \-b 80 Each line is preceded by the block number on which it was found. 81 This is sometimes useful 82 in locating disk block numbers by context. 83 Block numbers start with 0. 84 .TP 85 .B \-c 86 Only a count of matching lines is printed. 87 .TP 88 .BI \-e\ string_list 89 Specifies one or more strings, separated by newline characters. 90 A line is selected if one or more of the specified strings are found. 91 .TP 92 .BI \-f\ string_file 93 One or more strings, separated by newline 94 characters, are read from 95 .I string_file. 96 If multiple 97 .B \-e 98 or 99 .B \-f 100 options are supplied to 101 .BR /usr/5bin/posix/fgrep , 102 all of the pattern lists will be evaluated. 103 .TP 104 .B \-h 105 Normally, the name of each input file is printed before a match 106 if there is more that one input file. 107 When this option is present, no file names are printed. 108 .TP 109 .B \-i 110 Upper- and lowercase differences are ignored when searching matches. 111 .TP 112 .B \-l 113 The names of files with matching lines are listed 114 (once) separated by newlines. 115 .TP 116 .B \-n 117 Each line is preceded by its line number in the file. 118 Line numbers start with 1. 119 .TP 120 .B \-v 121 All lines but those matching are printed. 122 .TP 123 .B \-x 124 (Exact) only lines matched in their entirety are printed. 125 .PP 126 The following options are supported as extensions: 127 .TP 128 .B \-r 129 With this option given, 130 .I fgrep 131 does not directly search in each given file that is a directory, 132 but descends it recursively 133 and scans each regular file found below it. 134 Device files are ignored. 135 Symbolic links are followed. 136 .TP 137 .B \-R 138 Operates recursively as with the 139 .I \-r 140 option, 141 but does not follow symbolic links that point to directories 142 unless if they are explicitly specified as arguments. 143 .TP 144 .B \-z 145 If an input file is found to be compressed with 146 .IR compress (1), 147 .IR gzip (1), 148 or 149 .IR bzip2 (1), 150 the appropriate compression program is started, 151 and 152 .I fgrep 153 searches for the pattern in its output. 154 .PP 155 .B /usr/5bin/s42/fgrep 156 and 157 .B /usr/5bin/posix2001/fgrep 158 are identical to 159 .BR /usr/5bin/posix/fgrep . 160 .SH "ENVIRONMENT VARIABLES" 161 .TP 162 .BR LANG ", " LC_ALL 163 See 164 .IR locale (7). 165 .TP 166 .B LC_CTYPE 167 Determines the mapping of bytes to characters 168 and the case mapping for the 169 .B \-i 170 option. 171 .SH "SEE ALSO" 172 ed(1), 173 egrep(1), 174 grep(1), 175 sed(1), 176 locale(7) 177 .SH DIAGNOSTICS 178 Exit status is 0 if any matches are found, 179 1 if none, 2 for syntax errors or inaccessible files.