Question 290
A user working at a Linux terminal reports: A report contains hundreds of rows and a trainee needs to count only its lines but opens it in a pager and counts manually. Which finding would validate the selected approach?
Explanation
Correct Answer
The count matches a known three-line fixture and remains stable after repeated runs. This is specific evidence for the stated requirement. The explanation is: The wc utility counts lines, words or bytes according to its options and reads the file directly. The required action is: Run wc -l report.txt to count newline-terminated lines.
Incorrect Answers
This test can succeed without resolving the cause described here. It addresses: An unescaped dot matches an arbitrary character in a basic regular expression. The relevant causal dependency is: The wc utility counts lines, words or bytes according to its options and reads the file directly. The required validation is “The count matches a known three-line fixture and remains stable after repeated runs”.
The alternative measures an outcome associated with: Standard output and standard error are separate numbered streams handled by the shell's redirection syntax. It does not verify the stated failure. Here the wc utility counts lines, words or bytes according to its options and reads the file directly. Confirm “The count matches a known three-line fixture and remains stable after repeated runs”.
That observation would verify a different mechanism: Head selects the initial portion of an input stream while tail selects its end. It would not establish whether the present failure was corrected, because the wc utility counts lines, words or bytes according to its options and reads the file directly. Test “The count matches a known three-line fixture and remains stable after repeated runs” instead.