Questions tagged [tty]

A representation of a device that asynchronously transmits and receives serial data.

A TTY is a character device provided by the kernel that has certain configurable options such as baud rate, flow control, and parity. These options were necessary for the operation of early computer terminals and are still necessary for certain types of hardware (such as an RS-232 port or a USB-to-serial converter).

Because early computer terminals were represented as TTY devices, Unix-like operating systems usually use a TTY device as a primary way of communicating with the user. Shells typically run inside of terminal emulators, which are presented to the kernel and to userspace programs as a TTY (possibly via a P(seudo)TY interface); the stdin, stdout, and stderr of the shell and the programs it runs are all run through the TTY/PTY device.

Questions with this tag should relate in some way to a program's interaction with a PTY or TTY device, or to a physical TTY device or its drivers.

Further reading:

995 questions
1638
votes
10 answers

What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'?

I think these terms almost refer to the same thing, when used loosely: terminal shell tty console What exactly does each of these terms refer to?
Lazer
  • 36,385
243
votes
8 answers

Why do I need a tty to run sudo if I can sudo without a password?

I have configured sudo to run without a password, but when I try to ssh 'sudo Foo' , I still get the error message sudo: sorry, you must have a tty to run sudo . Why does this happen and how can I work around it?
merlin2011
  • 4,319
187
votes
3 answers

Linux: Difference between /dev/console, /dev/tty and /dev/tty0

On a Linux system, what is the difference between /dev/console , /dev/tty and /dev/tty0 ? What are their respective uses, and how do they compare?
164
votes
3 answers

Difference between pts and tty

Possible Duplicate: What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? I always see pts and tty when I use the who command but I never understand how they are different? Can somebody please explain me this?
144
votes
16 answers

How to connect to a serial port as simple as using SSH?

Is there a way to connect to a serial terminal just as you would do with SSH? There must be a simpler way than tools such as Minicom, like this $ serial /dev/ttyS0 I know I can cat the output from /dev/ttyS0 but only one way communication is…
norq
  • 4,181
94
votes
4 answers

What are the responsibilities of each Pseudo-Terminal (PTY) component (software, master side, slave side)?

I am trying to figure out how a tty works 1 (the workflow and responsibilities of each element). I have read several interesting articles about it, but there are still some blurry areas. This is what I understand so far: The emulated terminal makes…
Pierre-Jean
  • 2,299
80
votes
7 answers

Can I change the font of the text-mode console?

I have a Unix-like OS installed without a windowing environment; i.e. , just a text-mode console and no GUI. Is it possible to change the font used by the console? To be clear, I am not talking about the terminal emulator that comes with a desktop…
Weihang Jian
  • 1,357
  • 2
  • 12
  • 18
68
votes
10 answers

How can I hook on to one terminal's output from another terminal?

I need to hook onto output of currently running terminal (tty1) from virtual terminal and capture it (running X server).
Tomas Pruzina
  • 911
  • 1
  • 8
  • 8
64
votes
3 answers

Can a terminal emulator be as fast as TTY 1-6?

I've been trying various terminal emulators lately, from the built-in gnome-terminal, aterm, xterm, wterm, to rxvt. The test I've been doing is in this order: Open up a tmux window with 2 panes The left pane will be an verbose-intensive task such as…
user17537
  • 749
58
votes
1 answer

How to read/write to tty* device?

I have a device that sends information over USB to my computer. Arch Linux sets up this device by creating a file named ttyUSB0 in /dev/ . I have been using GTKterm to receive this incoming information and display it in an emulated terminal window.…
sherrellbc
  • 2,621
51
votes
3 answers

How to find which serial port is in use?

The Question: I plugged in a device (i.e. GSM modem) through a serial port (a.k.a. RS-232), and I need to see with which file in /dev/ filesystem this device was tied up, to be able to communicate with it. Unfortunately there is no newly created…
Hi-Angel
  • 5,730
48
votes
6 answers

Start a process on a different tty

After about an hour of Googling this, I can't believe nobody has actually asked this question before... So I've got a script running on TTY1. How do I make that script launch some arbitrary program on TTY2? I found tty , which tells you which TTY…
47
votes
4 answers

set baud speed for tty

How do I set the baud speed for a specific tty (in this case a serial port)? I tried using stty -F /dev/tty.iap ispeed 19200 But get the error Invalid argument for every speed I try (2400, 4800, etc.) except 9600 (the default). I can successfully…
47
votes
2 answers

What is the difference between ttyS0, ttyUSB0 and ttyAMA0 in Linux?

I want to know the difference between ttyS0 , ttyUSB0 and ttyAMA0 on Linux.
46
votes
6 answers

How to get the tty in which bash is running?

In the second method proposed by this page , one gets the tty in which bash is being run with the command: ps ax | grep $$ | awk '{ print $2 }' I though to myself that surely this is a bit lazy, listing all running processes only to extract one of…
Jonathan H
  • 2,593
1
2 3
…
66 67