r/linux_programming • • Jun 14 '19

Understanding about grep implementation

Hi everyone, so I was reading about grep command in my free time and I got to wondering that how does grep technically implements highlighting of matched strings in text? Like I grep for abc in xyz file then it highlights all the occurrences of abc in stdout. Any idea how it is achieved?

6 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/nderflow Jun 15 '19

You could make a simple example and step through it in a debugger.