Linux Foundation Certified System Administrator (LFCS) — Question 32
Which of the following statements is correct regarding the command foo 1> bar?
Answer options
- A. The stdout from the command foo is appended to the file bar.
- B. The stdout from the command foo overwrites the file bar.
- C. The command foo receives its stdin from the file bar.
- D. The command foo receives its stdin from the stdout of the command bar.
- E. The stderr from the command foo is saved to the file bar.
Correct answer: B
Explanation
The correct answer is B because the command 'foo 1> bar' redirects the standard output (stdout) of 'foo' to overwrite the contents of 'bar'. Option A is incorrect since it describes appending rather than overwriting, while options C, D, and E do not correctly describe the behavior of the command regarding standard input and standard error.