Linux_FoundationLinux_Foundation
LFCS · Question #797
LFCS Question #797: Real Exam Question with Answer & Explanation
The correct answer is B: It only outputs non-matching lines.. When the -v option is used with the egrep command, it performs an inverse match, showing only lines that do not contain the specified pattern.
Submitted by luis.pe· Apr 18, 2026Essential Commands
Question
What is the effect of the egrep command when the -v option is used?
Options
- AIt enables color to highlight matching parts.
- BIt only outputs non-matching lines.
- CIt shows the command's version information.
- DIt changes the output order showing the last matching line first.
Explanation
When the -v option is used with the egrep command, it performs an inverse match, showing only lines that do not contain the specified pattern.
Common mistakes.
- A. Enabling color highlighting is typically done with options like
--coloror through shell configuration, not-v. - C. Displaying version information for a command is usually achieved with
--versionor-V, not-v. - D. The
-voption filters lines based on whether they match a pattern; it does not alter the order of the output.
Concept tested. egrep -v option (invert match)
Reference. https://www.gnu.org/software/grep/manual/grep.html
Topics
#grep#egrep#command-line options#text processing
Community Discussion
No community discussion yet for this question.