Question 240
A Linux administrator needs to resolve the following condition: A log parser misses errors written to stderr when stdout is redirected. Which change BEST addresses the root cause?
Explanation
Correct Answer
The fix addresses the cause: redirecting stdout alone does not capture error diagnostics. A suitable acceptance test is that the error message appears in the intended collection file.
Incorrect Answers
That remedy is appropriate when a security script needs an exact count of lines matching a pattern rather than the matching text. It targets grep -c counts matching lines instead of printing all matching lines; here redirecting stdout alone does not capture error diagnostics, so it does not directly repair the observed fault.
It would correct a separate failure, a maintenance script overwrites a log although operators intended to append. In this environment, redirecting stdout alone does not capture error diagnostics; the indicated alternative does not meet the acceptance test.
That remedy is appropriate when an administrator wants to see two most recent lines of a growing log interactively. It targets tail can follow newly appended data from a file; here redirecting stdout alone does not capture error diagnostics, so it does not directly repair the observed fault.





CompTIA Linux+ (XK0-006) Practice Tests