1.\" $FreeBSD: head/usr.bin/grep/grep.1 210578 2010-07-29 00:11:14Z gabor $ |
2.\" $OpenBSD: grep.1,v 1.38 2010/04/05 06:30:59 jmc Exp $ 3.\" Copyright (c) 1980, 1990, 1993 4.\" The Regents of the University of California. 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.\" 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" @(#)grep.1 8.3 (Berkeley) 4/18/94 31.\" |
32.Dd July 28, 2010 |
33.Dt GREP 1 34.Os 35.Sh NAME 36.Nm grep , egrep , fgrep , 37.Nm zgrep , zegrep , zfgrep 38.Nd file pattern searcher 39.Sh SYNOPSIS 40.Nm grep --- 140 unchanged lines hidden (view full) --- 181Specify a pattern used during the search of the input: 182an input line is selected if it matches any of the specified patterns. 183This option is most useful when multiple 184.Fl e 185options are used to specify multiple patterns, 186or when a pattern begins with a dash 187.Pq Sq - . 188.It Fl Fl exclude |
189If specified, it excludes files matching the given 190filename pattern from the search. 191Note that 192.Fl Fl exclude 193patterns take priority over 194.Fl Fl include 195patterns, and if no 196.Fl Fl include 197pattern is specified, all files are searched that are 198not excluded. 199Patterns are matched to the full path specified, 200not only to the filename component. |
201.It Fl Fl exclude-dir 202If 203.Fl R 204is specified, it excludes directories matching the |
205given filename pattern from the search. 206Note that 207.Fl Fl exclude-dir 208patterns take priority over 209.Fl Fl include-dir 210patterns, and if no 211.Fl Fl include-dir 212pattern is specified, all directories are searched that are 213not excluded. |
214.It Fl F , Fl Fl fixed-strings 215Interpret 216.Ar pattern 217as a set of fixed strings 218(i.e. force 219.Nm grep 220to behave as 221.Nm fgrep ) . --- 27 unchanged lines hidden (view full) --- 249.Fl Fl binary-file Ns = Ns Ar without-match 250option. 251.It Fl i , Fl Fl ignore-case 252Perform case insensitive matching. 253By default, 254.Nm grep 255is case sensitive. 256.It Fl Fl include |
257If specified, only files matching the 258given filename pattern are searched. 259Note that 260.Fl Fl exclude 261patterns take priority over 262.Fl Fl include 263patterns. 264Patterns are matched to the full path specified, 265not only to the filename component. |
266.It Fl Fl include-dir 267If 268.Fl R |
269is specified, only directories matching the 270given filename pattern are searched. 271Note that 272.Fl Fl exclude-dir 273patterns take priority over 274.Fl Fl include-dir 275patterns. |
276.It Fl J, Fl Fl bz2decompress 277Decompress the 278.Xr bzip2 1 279compressed file before looking for the text. 280.It Fl L , Fl Fl files-without-match 281Only the names of files not containing selected lines are written to 282standard output. 283Pathnames are listed once per file searched. --- 204 unchanged lines hidden --- |