Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Question 40 of 42
Free Preview · 42 of 140 · questions 1–42 of 140 are free. Sign up free to sync your progress across devices.
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
This is wrong. It means standard output to standard error, what is already unusual. https://www.thomas-krenn.com/de/wiki/Bash_stdout_und_stderr_umleiten
In Bash, inserting '1>&2' after a command redirects standard output to standard error. Option C is the correct answer. In Bash, the '>' symbol is used to redirect output from a command to a file. The '&' symbol is used to specify a file descriptor, which is a numerical identifier for a file that is used by the operating system to keep track of open files. The number '1' specifies the standard output file descriptor, and the number '2' specifies the standard error file descriptor. Therefore, the command '1>&2' redirects the standard output file descriptor ('1') to the standard error file descriptor ('2'). This means that the output of the command will be written to the standard error instead of the standard output.
The other options do not accurately describe what happens when '1>&2' is inserted after a command: Option A: Standard error is not redirected to standard input. Option B: Standard input is not redirected to standard error. Option D: Standard error is not redirected to standard output. Option E: Standard output is not redirected to standard input. To redirect standard error to standard output, you can use the command '2>&1'. This will redirect the standard error file descriptor ('2') to the standard output file descriptor ('1'). This means that the error output of the command will be written to the standard output along with the normal output.