Skip to content
Search

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

From the documentation:

  • /dev/tty: Current TTY device
  • /dev/console: System console
  • /dev/tty0: Current virtual console

The differences are as follows.

  • /dev/console is 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 multiple console= options are passed to the kernel, the console output will go to more than one device.
  • /dev/tty0 is the current virtual console
  • /dev/tty[1-x] is one of the virtual consoles you switch to with control-alt-F1 and so on.
  • /dev/tty is 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 the TTY column of ps -ef output.

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

Favorite site

References


  1. BASH_shell-script.pdf ↩

author Zer0 sitemap