

grep                         Command                         grep




Pattern search

ggrreepp [ooppttiioonn ...] [_p_a_t_t_e_r_n] [_f_i_l_e ...]

grep searches each file for occurrences of the pattern (sometimes
called  a regular  expression).  If  no  file is  specified, grep
searches the  standard input.  The  pattern is given  in the same
manner as  to ed.  Normally,  grep prints each  line matching the
pattern.

The following options are available.

-bb  With  each output line,  print the block number  in which the
    line started (used to search file systems).

-cc  Print the count of matching lines rather than the lines.

-ee  The  next argument is  pattern (useful if  the pattern starts
    with `-').

-ff  The  next argument  is a file  containing a list  of patterns
    separated by newlines; there is no pattern argument.

-hh  When more than one  file is specified, output lines are norm-
    ally accompanied by the file name; -h suppresses this.

-ll  Print the name  of each file containing matching lines rather
    than the lines.

-nn  The line number in the file accompanies each line printed.

-ss  Suppress all output, just return status.

-vv  Print a line if the pattern is not found in the line.

-xx  Print the line only if it is exactly the same as the pattern;
    treat wildcards in the pattern as plain text.

-yy  Lower-case letters in the pattern match lower-case and upper-
    case letters on the input lines.

***** See Also *****

awk, commands, ed, egrep, expr, lex, sed

***** Diagnostics *****

grep  returns an  exit status  of  zero for  success, one  for no
matches, two for error.

***** Notes *****

egrep is an extended and faster version of grep.



COHERENT Lexicon                                           Page 1


