grep
Also found in: Dictionary, Thesaurus, Medical, Legal, Acronyms, Wikipedia.
grep
(tool, information science)<tool> A Unix command for
searching files for lines matching a given regular expression (RE). Named after the qed/ed editor
subcommand "g/re/p", where re stands for a regular expression,
to Globally search for the Regular Expression and Print the
lines containing matches to it. There are two other variants,
fgrep which searches only for fixed strings and egrep which
accepts extended REs but is usually the fastest of the three.
Used by extension to mean "to look for something by pattern". When browsing through a large set of files, one may speak of "grepping around". "Grep the bulletin board for the system backup schedule, would you?" See also vgrep.
Used by extension to mean "to look for something by pattern". When browsing through a large set of files, one may speak of "grepping around". "Grep the bulletin board for the system backup schedule, would you?" See also vgrep.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)
grep
(Global Regular Expression and Print) A Unix pattern matching utility that searches files for a string of text and outputs the line that contains the pattern. Grep came from ed, a Unix text editor, in which the command g/re/p meant "display all text in the file that matches this." That single function became a utility itself, available on all major platforms today. This is an example of the rich family of command line functions built into Unix long before WindowsThe following real life example used grep to find occurrences of the text "xfiles.lst" within any .CMD files in the default folder. The results show the matching files and text. See Unix.
Grep Windows Example |
---|
The command grep "xfiles.lst" *.cmd looks for CMD files that contain the text xfiles.lst. Grep found NEWXMLM.CMD and WHATSNEW.CMD matching the text string. |
Copyright © 1981-2019 by The Computer Language Company Inc. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.