6 ms·
Grep is from an ed editor command: global (g) to apply a command to all lines that match a regular expression, a regex surrounded by slashes (/), and print (p)
by alexjm 2y ago
Grep is from an ed editor command: global (g) to apply a command to all lines that match a regular expression, a regex surrounded by slashes (/), and print (p) to display those lines. Or g/re/p for short. This proved a useful enough operation that they made it a separate command in the early days of Unix.
- xanderlewis 2y agoYeah! I've heard this many times, but it never sticks in my mind.