4 ms·
That actually comes from ed and vi. The g command would search for a line that matches a given regular expression and run the following command on that line.
by u801e 6y ago
That actually comes from ed and vi. The g command would search for a line that matches a given regular expression and run the following command on that line. The v command was the inverse (search for lines that don't match the given regular expression).
The default command was to just print the line. Hence the name grep
g/re/p