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.

8
  • Is the "Unit ID" line always going to be immediately after the first line you want to see? Commented Oct 10, 2013 at 16:18
  • If you know it's just the two lines, why are you using -B20 -A20? You might also want to look at: unix.stackexchange.com/questions/94243/… Commented Oct 10, 2013 at 16:19
  • @kurtm Yes the Unit ID line is always after the first line I show there. Commented Oct 10, 2013 at 16:21
  • @peterph it's actually a little bit more than two lines(i just wanted to simplify the question) but those two lines are always right after the other. Commented Oct 10, 2013 at 16:22
  • Since the dates are ascending you can use sed to print a range: sed -n '/Oct 10 10:58:50/,/Oct 10 23:58:50/p' Commented Oct 10, 2013 at 16:26