---

How to Grep 2 Lines using grep in Linux?

grep is excellent to match patterns from STDOUT/text files in command line or scripts. It’s handy. Sometimes, our problem is more complex than finding a keyword from a file. On a first thought, it may sound impossible using grep for such complex problems. But grep can be quite powerful than we thought. Today, let’s check one example.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis