Exam LFCS All QuestionsBrowse all questions from this exam
Question 59

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

    Correct Answer: B

    The -v option in the egrep command inverts the matching criteria, causing it to output only the lines that do not match the specified pattern.

Discussion
rhylosOption: B

Correct. To invert the Grep output , use the -v flag. The -v option instructs grep to print all lines that do not contain or match the expression. The –v option tells grep to invert its output, meaning that instead of printing matching lines, do the opposite and print all of the lines that don't match the expression.

BorbzOption: B

Correct. -v or --invert-match is for selecting non-matching lines.