Intermediate
Linux & Shell Scripting
Q57 / 100
What is the difference between "file descriptors" 0, 1, and 2 in Unix-like systems?
Correct! Well done.
Incorrect.
The correct answer is A) 0 represents standard input (stdin), 1 represents standard output (stdout), and 2 represents standard error (stderr) — these are the default I/O streams every process starts with
A
Correct Answer
0 represents standard input (stdin), 1 represents standard output (stdout), and 2 represents standard error (stderr) — these are the default I/O streams every process starts with
Explanation
These three standard file descriptors are conventionally assigned: stdin (0) for input, stdout (1) for normal output, and stderr (2) for error messages, and can be individually redirected (e.g. "2>error.log").
Progress
57/100