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」的做法已被廢除。