Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ grep(I) — UNIX 6th Edition 1.3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ed (I)

sh (I)

GREP(I)  −  PWB/UNIX 5/15/74

NAME

grep − search a file for a pattern

SYNOPSIS

grep [ −v ] [ −b ] [ −c ] [ −n ] expression [ file ] ... 

DESCRIPTION

Grep searches the input files (standard input default) for lines matching the regular expression.  Normally, each line found is copied to the standard output.  If the −v flag is used, all lines but those matching are printed.  If the −c flag is used, only a count of matching lines is printed.  If the −n flag is used, each line is preceded its relative line number in the file.  If the −b flag is used, each line is preceded by the block number on which it was found.  This is sometimes useful in locating disk block numbers by context.  In all cases the file name is shown if there is more than one input file. For a complete description of the regular expression, see ed (I). Care should be taken when using the characters $ * [ ^ | ( ) and \ in the regular expression as they are also meaningful to the Shell. It is generally necessary to enclose the entire expression argument in quotes. 

SEE ALSO

ed (I), sh (I)

BUGS

Lines are limited to 256 characters; longer lines are truncated. 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026