Hacker News new | ask | show | jobs
by milliams 1595 days ago
I have problems remembering the mnemonic for -A and -B. I can't get it straight whether it's "before" and "after" or "above" and "below". I always just try one then the other!
4 comments

I've never had trouble remembering, but after reading this comment I'm afraid I might start :(

(joking)

The way I remember this is by keeping in mind that grep processes the area of the search as a stream of discrete lines by looking at each line individually. "Above/below" are concepts on the stream level, and "after/before" are on the line level.
A after, B before, C context (for both)
Same!