grep - print lines matching a pattern.
On this page we only give you a short introduction with a few examples. We encourage you to read the manual (
(Source:  - Creative Commons Attribution-ShareAlike License)
grepis a command-line utility for searching plain-text data sets for lines that match a regular expression. Its name comes from the ed command g/re/p (globally search a regular expression and print), which has the same effect: doing a global search with the regular expression and printing all matching lines.
Search for lines containing a regular expression
$ grep just one-file.txt This is just some text
Compare this to a printout of the entire content of the file:
$ cat one-file.txt Hi there This is just some text /John Doe