问题描述:

grep -2riP

I saw it on commandline fu. I checked the man page, but could not find it, it is possible that I may have missed it.

网友答案:

From the grep man-page:

-C NUM, -NUM, --context=NUM Print NUM lines of output context. Places a line containing a group separator (described under --group-separator) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given.

so, grep -2 is equivalent to grep -C 2, which tells grep to display 2 lines before and after a match.

相关阅读:
Top