On Lubuntu 18.04, I run a shell in lxterminal. Its controlling terminal is the current pseudoterminal slave:
$ tty /dev/pts/2
I would like to know what relations are between my current controlling terminal
/dev/ttyacts like my current controlling terminal
$ echo hello > /dev/tty hello $ cat < /dev/tty world world ^C
But they seem to be unrelated files, instead of one being a symlink or hardlink to the other:
$ ls -lai /dev/tty /dev/pts/2 5 crw--w---- 1 t tty 136, 2 May 31 16:38 /dev/pts/2 13 crw-rw-rw- 1 root tty 5, 0 May 31 16:36 /dev/tty
For different sessions with different controlling terminals, if
/dev/tty is guaranteed to be their controlling terminals. How can
it be different controlling terminals, without being a symlink or
So what are their relations and differences? Any help is much appreciated!
This post is originated from an earlier one Do the output of command `tty` and the file `/dev/tty` both refer to the controlling terminal of the current bash process?