Teletypewriter
lastmod 2026-01-13created 2016-06-2514 edits
A teleprinter, or teletypewriter (teletypewriter or TTY), is an electromechanical typewriter used for point-to-point and point-to-multipoint communication, widely used over various communication channels ranging from simple wire connections to radio and microwave links. In addition, on early mainframes and minicomputers it was used to send typed data to the computer, print the computer's responses, and serve as a command-line interface. (TTY is still used as the term for a terminal on modern Unix-like systems)
Linux
Linux tty (TeleTYpewriter; TTY): Linux teletypewriter, remote typewriter.
- Linux terminal, console
- Linux command to check the terminal
- Linux command that prints the terminal name
- Prints the file name of the terminal device connected to standard input
tty command-line tool
Returns the user's terminal name.
/dev/tty vs /dev/console
- Difference between /dev/tty and /dev/console
- Linux: Difference between /dev/console , /dev/tty and /dev/tty0
From the documentation:
-
/dev/tty: Current TTY device -
/dev/console: System console -
/dev/tty0: Current virtual console
The differences are as follows.
-
/dev/consoleis a virtual set of devices which can be set as a parameter at boot time. It might be redirected to a serial device or a virtual console and by default points to/dev/tty0. When multipleconsole=options are passed to the kernel, the console output will go to more than one device. -
/dev/tty0is the current virtual console -
/dev/tty[1-x]is one of the virtual consoles you switch to withcontrol-alt-F1and so on. -
/dev/ttyis the console used by the process querying it. Unlike the other devices, you do not need root privileges to write to it. Note also that processes like the ones launched by cron and similar batch processes have no usable/dev/tty, as they aren't associated with any. These processes have a?in theTTYcolumn ofps -efoutput.
Troubleshooting
/dev/ttyUSB0 connection drops by itself on Ubuntu
See Universal Serial Bus#/dev/ttyUSB0 connection drops by itself on Ubuntu. In short, remove brltty with sudo apt purge brltty.
Unicode characters like ë are suddenly entered
See Terminal emulator#How to enter Unicode characters on Linux.
Unicode characters like e̲ are suddenly entered
See Emoji#Emoji insertion mode.
See also
- stty
- Bash
- xterm.js
- terminfo
- ANSI escape code (Terminal Control Escape Sequences)
- Software flow control
- libghostty - An embeddable terminal emulator library usable from any application
- Ghostty-web - A web terminal that compiles Ghostty to WASM and is compatible with the xterm.js API
- ttyd - https://github.com/tsl0922/ttyd
- gotty - https://github.com/yudai/gotty
- wetty - https://github.com/butlerx/wetty
- sshwifty - https://github.com/nirui/sshwifty
Favorite site
- KLDP: What is /dev/tty?
- Linux/Unix: About terminals, tty, consoles, and shells
- Zetawiki - /dev/tty
- Zetawiki - Linux tty
- Zetawiki - /dev/pts/0
- Wikipedia (en) Teletypewriter
- TTY - Bash Shell Script 1
References
-
BASH_shell-script.pdf ↩