Question 360
Before changing a Linux system, an engineer observes: A command writes reports to standard output and warnings to standard error but only reports should enter a data file. Which check most directly isolates the relevant cause or prerequisite?
Explanation
Correct Answer
Identify which messages use file descriptor 1 versus file descriptor 2. This isolates the relevant condition before applying a change. The appropriate corrective response is: Redirect only stdout with command > report.txt and leave stderr separate.
Incorrect Answers
Inspect whether the program accepts data from stdin rather than requiring a file pathname. That would matter when a program reads input from standard input but the data already exists in a local file. The relevant distinction in this case is: Identify which messages use file descriptor 1 versus file descriptor 2.
Inspect the target file's current contents and which descriptor needs to be saved. That would matter when a maintenance script should append standard output to a cumulative log while retaining earlier runs. It does not address this case's requirement: A command writes reports to standard output and warnings to standard error but only reports should enter a data file.
Inspect the redirection ordering and decide whether both descriptors should share the file. That would matter when a script needs to record both standard output and error output in a single file for one command. That separate mechanism does not verify the needed Linux administration outcome in this case.