Skip to content
EntityQ283302· pop 37· linked from 315 articles

Also known as Global Regular Expression Print

grep is a command-line utility for searching text for lines that match a regular expression. Its name comes from the ed command g/re/p (global, regular expression, print), which has the same effect. grep was originally developed for the Unix operating system, and is commonly available on Unix-like and some other systems such as OS-9. The shell command that runs the utility has the same name: .

Key facts

Software.name
grep
Software.title
grep
Software.screenshot
Grep example.png
Software.caption
Example of grep command
Software.screenshot size
300px
Software.author
Ken Thompson
Software.developer
AT&T Bell Laboratories
Software.programming language
C
Software.operating system
Unix, Unix-like, Plan 9, Inferno, OS-9, MSX-DOS, IBM i
Software.genre
Command

via Wikipedia infobox

Described at

Link to a page describing this subject · 15,689 chars · not written by Vinony

Wikidata facts

Image
Grep example.png
Show 5 more facts
inception
1973-00-00
Commons category
Grep
Stack Exchange tag
stackoverflow.com/tags/grep
has command line option
x
Sources (4)

via Wikidata · CC0

~6 min read

Article

7 sections
Contents
  • History
  • Implementations
  • agrep
  • Usage as a verb<!-- "Google_(verb)" links here -->
  • See also
  • References
  • External links

grep is a command-line utility for searching text for lines that match a regular expression. Its name comes from the ed command g/re/p (global, regular expression, print), which has the same effect. grep was originally developed for the Unix operating system, and is commonly available on Unix-like and some other systems such as OS-9. The shell command that runs the utility has the same name: .

==History== Before it was named, grep was a private utility written by Ken Thompson to search files for certain patterns. Doug McIlroy, unaware of its existence, asked Thompson to write such a program. Responding that he would think about such a utility overnight, Thompson actually corrected bugs and made improvements for about an hour on his own program called s (short for "search"). The next day he presented the program to McIlroy, who said it was exactly what he wanted. Thompson's account may explain the belief that grep was written overnight.

Connections

Categories