Multiple choice technology programming languages

What do you use to forward errors to a file?

  1. 1> filename

  2. 2> /dev/null

  3. &> filename

  4. 2> filename

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In Unix and Linux shells, file descriptor 2 represents standard error (stderr). Using 2> filename redirects standard error output to the specified file, whereas 1> handles standard output and &> captures both.