The Nerdy Sixty | (20/60) Why is it called grep? | Solution

The Unix tool name “grep” is odd. What is the origin of the name “grep”?

Hint 1: It’s named after an old Unix editor command that searched globally for a regex and printed matches.

Hint 2: Think of the command in ed: g//p.

 

Solution:

The name “grep” is derived from the Unix `ed` editor command `g/re/p` (global – regular expression – print). In the `ed` editor, typing g/re/p would search for a regex and print matching lines. The standalone tool “grep” was named after this sequence, as it performs the same action outside the editor.

 

 


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Cookie Notice by Real Cookie Banner