A shell in Linux (for example: bash
) have its stdin
and stdout
and stderr
file descriptors all point to the same device file, for example, the following are thestdin
and stdout
and stderr
file descriptors for bash
:
Now /dev/tty1
is not a "real" file that you can read from and write to, it is a device file that points to a file or to a buffer in memory or to something else.
Now my question is, does /dev/tty1
points to only one file, or does it point to two files?
What I mean is, when bash
reads from /dev/tty1
(stdin
), and when bash
writes to /dev/tty1
(stdout
or stderr
), is it reading from and writing to the same file, or does /dev/tty1
points to two files, one is used when reading from /dev/tty1
, and the other is used when writing to /dev/tty1
?