<p>grep is a command-line utility for searching plain-text data sets for lines matching a regular expression. Grep was originally developed for the Unix operating system, but is available today for all Unix-like systems. Its name comes from the ed command g/re/p (global / regular expression / print).
Grep was created by Ken Thompson as a standalone application adapted from the regular expression parser he had written for ed (which he also created). In ed, the command g/re/p would print all lines matching a previously defined pattern. Grep's official creation date is given as March 3, 1973, in the Manual for Unix Version 4.
Grep searches files specified as arguments, or, if missing, the program's standard input. By default, it reports matching lines on standard output, but specific modes of operation may be chosen with command line options.
A simple example of a common usage of grep is the following, which searches the file fruitlist.txt for lines containing the text string apple:
Matches occur when the specific sequence of characters is recognized, for example, lines containing pineapple or apples are printed irrespective of word boundaries. However, the search pattern specified as an</p>