Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • He only wants to print the two lines with the text that he specified. This prints absolutely everything and is effectively no different than using cat. Commented Feb 14, 2019 at 13:09
  • @NasirRiley the OP added a comment to Hexiel's answer saying that -A5 made it do what he wanted, which means he didn't only want those 2 lines. And you only get "absolutely everything" if your file is only his example output, and nothing in between multiple instances of those 2 lines. Commented Feb 14, 2019 at 20:09
  • That wasn't stated anywhere in his question. In fact, in his comments to the question, he clearly stated that he just wanted those two lines and gave the expected output as those two lines. Secondly, it's entirely possible that a log file could contain only those lines depending on what was being written to it and for how long. I'm only suggesting that what he stated he wanted is totally different than what he would get from Hexial's answer which he stated worked perfectly and that there should be more clarity. Commented Feb 14, 2019 at 22:41