Print this page
3737 grep does not support -H option
Reviewed by: Andy Stormont <andyjstormont@gmail.com>
   1 '\" te
   2 .\" Copyright 2012 Nexenta Systems, Inc. All rights reserved.
   3 .\" Copyright 1989 AT&T
   4 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved
   5 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
   6 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
   7 .\" http://www.opengroup.org/bookstore/.
   8 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
   9 .\"  This notice shall appear on any product containing this material.
  10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
  11 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
  12 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
  13 .TH GREP 1 "Feb 26, 2008"
  14 .SH NAME
  15 grep \- search a file for a pattern
  16 .SH SYNOPSIS
  17 .LP
  18 .nf
  19 \fB/usr/bin/grep\fR [\fB-c\fR | \fB-l\fR |\fB-q\fR] [\fB-r\fR | \fB-R\fR] [\fB-bhinsvw\fR]
  20     \fIlimited-regular-expression\fR [\fIfilename\fR]...
  21 .fi
  22 
  23 .LP
  24 .nf
  25 \fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-r\fR | \fB-R\fR]
  26     [\fB-bhinsvwx\fR] \fB-e\fR \fIpattern_list\fR... [\fB-f\fR \fIpattern_file\fR]...
  27     [\fIfile\fR]...
  28 .fi
  29 
  30 .LP
  31 .nf
  32 \fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-r\fR | \fB-R\fR]
  33     [\fB-bhinsvwx\fR] [\fB-e\fR \fIpattern_list\fR]... \fB-f\fR \fIpattern_file\fR...
  34     [\fIfile\fR]...
  35 .fi
  36 
  37 .LP
  38 .nf
  39 \fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-r\fR | \fB-R\fR]
  40     [\fB-bhinsvwx\fR] \fIpattern\fR [\fIfile\fR]...
  41 .fi
  42 
  43 .SH DESCRIPTION
  44 .sp
  45 .LP
  46 The \fBgrep\fR utility searches text files for a pattern and prints all lines
  47 that contain that pattern.  It uses a compact non-deterministic algorithm.
  48 .sp
  49 .LP
  50 Be careful using the characters \fB$\fR, \fB*\fR, \fB[\fR, \fB^\fR, \fB|\fR,
  51 \fB(\fR, \fB)\fR, and \fB\e\fR in the \fIpattern_list\fR because they are also
  52 meaningful to the shell. It is safest to enclose the entire \fIpattern_list\fR
  53 in single quotes \fBa\'\fR\&...\fBa\'\fR\&.
  54 .sp
  55 .LP
  56 If no files are specified, \fBgrep\fR assumes standard input. Normally, each
  57 line found is copied to standard output. The file name is printed before each
  58 line found if there is more than one input file.
  59 .SS "/usr/bin/grep"
  60 .sp


  78 \fB/usr/xpg4/bin/grep\fR:
  79 .sp
  80 .ne 2
  81 .na
  82 \fB\fB-b\fR\fR
  83 .ad
  84 .RS 6n
  85 Precedes each line by the block number on which it was found. This can be
  86 useful in locating block numbers by context (first block is 0).
  87 .RE
  88 
  89 .sp
  90 .ne 2
  91 .na
  92 \fB\fB-c\fR\fR
  93 .ad
  94 .RS 6n
  95 Prints only a count of the lines that contain the pattern.
  96 .RE
  97 









  98 .sp
  99 .ne 2
 100 .na
 101 \fB\fB-h\fR\fR
 102 .ad
 103 .RS 6n
 104 Prevents the name of the file containing the matching line from being prepended
 105 to that line.  Used when searching multiple files.
 106 .RE
 107 
 108 .sp
 109 .ne 2
 110 .na
 111 \fB\fB-i\fR\fR
 112 .ad
 113 .RS 6n
 114 Ignores upper/lower case distinction during comparisons.
 115 .RE
 116 
 117 .sp


   1 '\" te
   2 .\" Copyright 2012 Nexenta Systems, Inc. All rights reserved.
   3 .\" Copyright 1989 AT&T
   4 .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved
   5 .\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
   6 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
   7 .\" http://www.opengroup.org/bookstore/.
   8 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
   9 .\"  This notice shall appear on any product containing this material.
  10 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
  11 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
  12 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
  13 .TH GREP 1 "May 3, 2013"
  14 .SH NAME
  15 grep \- search a file for a pattern
  16 .SH SYNOPSIS
  17 .LP
  18 .nf
  19 \fB/usr/bin/grep\fR [\fB-c\fR | \fB-l\fR |\fB-q\fR] [\fB-r\fR | \fB-R\fR] [\fB-bHhinsvw\fR]
  20     \fIlimited-regular-expression\fR [\fIfilename\fR]...
  21 .fi
  22 
  23 .LP
  24 .nf
  25 \fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-r\fR | \fB-R\fR]
  26     [\fB-bHhinsvwx\fR] \fB-e\fR \fIpattern_list\fR... [\fB-f\fR \fIpattern_file\fR]...
  27     [\fIfile\fR]...
  28 .fi
  29 
  30 .LP
  31 .nf
  32 \fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-r\fR | \fB-R\fR]
  33     [\fB-bHhinsvwx\fR] [\fB-e\fR \fIpattern_list\fR]... \fB-f\fR \fIpattern_file\fR...
  34     [\fIfile\fR]...
  35 .fi
  36 
  37 .LP
  38 .nf
  39 \fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-r\fR | \fB-R\fR]
  40     [\fB-bHhinsvwx\fR] \fIpattern\fR [\fIfile\fR]...
  41 .fi
  42 
  43 .SH DESCRIPTION
  44 .sp
  45 .LP
  46 The \fBgrep\fR utility searches text files for a pattern and prints all lines
  47 that contain that pattern.  It uses a compact non-deterministic algorithm.
  48 .sp
  49 .LP
  50 Be careful using the characters \fB$\fR, \fB*\fR, \fB[\fR, \fB^\fR, \fB|\fR,
  51 \fB(\fR, \fB)\fR, and \fB\e\fR in the \fIpattern_list\fR because they are also
  52 meaningful to the shell. It is safest to enclose the entire \fIpattern_list\fR
  53 in single quotes \fBa\'\fR\&...\fBa\'\fR\&.
  54 .sp
  55 .LP
  56 If no files are specified, \fBgrep\fR assumes standard input. Normally, each
  57 line found is copied to standard output. The file name is printed before each
  58 line found if there is more than one input file.
  59 .SS "/usr/bin/grep"
  60 .sp


  78 \fB/usr/xpg4/bin/grep\fR:
  79 .sp
  80 .ne 2
  81 .na
  82 \fB\fB-b\fR\fR
  83 .ad
  84 .RS 6n
  85 Precedes each line by the block number on which it was found. This can be
  86 useful in locating block numbers by context (first block is 0).
  87 .RE
  88 
  89 .sp
  90 .ne 2
  91 .na
  92 \fB\fB-c\fR\fR
  93 .ad
  94 .RS 6n
  95 Prints only a count of the lines that contain the pattern.
  96 .RE
  97 
  98 .sp
  99 .ne 2
 100 .na
 101 \fB\fB-H\fR\fR
 102 .ad
 103 .RS 6n
 104 Precedes each line by the name of the file containing the matching line.
 105 .RE
 106 
 107 .sp
 108 .ne 2
 109 .na
 110 \fB\fB-h\fR\fR
 111 .ad
 112 .RS 6n
 113 Prevents the name of the file containing the matching line from being prepended
 114 to that line.  Used when searching multiple files.
 115 .RE
 116 
 117 .sp
 118 .ne 2
 119 .na
 120 \fB\fB-i\fR\fR
 121 .ad
 122 .RS 6n
 123 Ignores upper/lower case distinction during comparisons.
 124 .RE
 125 
 126 .sp