What is the effect of the egrep command when the -v option is used?

A. It enables color to highlight matching parts.
B. It only outputs non-matching lines.
C. It shows the command's version information.
D. It changes the output order showing the last matching line first.

题解

「egrep」等同于「grep -E」,样本会使用延伸正则表达式 (ERE);「fgrep」等同于「grep -F」,样本是一组以换列分隔开的固定字符串。

「-v」会选取不符合的列,也就是会得到相反的结果,所以答案是选项 B。

现阶段来说,直接调用「egrep」或「fgrep」的做法已不建议使用。