Answered from Brian Kernighan: Inside Bell Labs, The Best Programmer, Why C Won · Ryan Peterman · 2026-10-26
Brian Kernighan explained that grep comes from the ed text editor, the first real editor on Unix. In ed, the g command runs another command on every line matching a regular expression, and the form g/re/p prints all lines that match the pattern. The name grep is simply that command sequence. Kernighan credited Ken Thompson with telling the story best.
Source: our own transcription of the episode. The full conversation is on Ryan Peterman (2026-10-26). Read the whole episode summary →