Search notes:

/dev/tty

tty stands for teletype.
In each process, /dev/tty is a synonym for the controlling terminal that is associated with the process group of the current process.
/dev/tty is particularly useful to make sure that messages are written or read from that terminal, no matter how input or output is redirected.

See also

/dev/console
/dev
The Shell command stty
TTY (Teletypewriter)
The Python stdlib module os has a ctermid() method which returns the filename of the controlling process's terminal.

Index