TIL: grep comes from ed’s g/re/p

It is amazing to learn trivias from the beginning of computers. grep is such an ubuquitous tool, and when one of my colleagues asked me “why is it called this way?”, I had to look it up. Turns out, it comes from the tool ed that has a mode g that matches a regular expression re to an action, here p for printing.

gglobal
reregular expression
pprint

See more detailed story from the teletype era at https://thenewstack.io/brian-kernighan-remembers-the-origins-of-grep/

Leave a Comment