当前位置: 动力学知识库 > 问答 > 编程问答 >

What does the digit 2 in this grep commandline mean?

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: