Linux Foundation Certified System Administrator (LFCS) — Question 71
In Bash, inserting 1>&2 after a command redirects
Answer options
- A. standard error to standard input.
- B. standard input to standard error.
- C. standard output to standard error.
- D. standard error to standard output.
- E. standard output to standard input.
Correct answer: C
Explanation
The command 1>&2 is used to redirect standard output (file descriptor 1) to standard error (file descriptor 2). This means that anything sent to standard output will instead be sent to standard error. The other options incorrectly describe the direction of the redirection.