Multiple choice technology operating systems

What is the command used for redirecting the standard error (stderr) to a file?

  1. <

  2. >>

  3. 2>

  4. <2

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

In shell scripting, file descriptors are numbered: 0 for stdin (standard input), 1 for stdout (standard output), and 2 for stderr (standard error). To redirect stderr to a file, you use > followed by the file descriptor number, so 2> means redirect file descriptor 2 (stderr) to a file.