LPIC-1 Exam 101 v5 (Linux Administrator) — Question 42
What is the effect of the -v option for the grep command?
Answer options
- A. It enables color to highlight matching parts.
- B. It shows the command's version information.
- C. It only outputs non-matching lines.
- D. It changes the output order showing the last matching line first.
- E. It outputs all lines and prefixes matching lines with a+.
Correct answer: C
Explanation
The correct answer is C because the -v option is specifically designed to invert the match, meaning it will only display lines that do not match the specified pattern. The other options describe functionalities that are not associated with the -v option: A relates to color output, B refers to version information, D describes a change in output order, and E discusses a prefix that is not part of the grep command's -v option functionality.