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:

896 questions
1508
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
  • 33,497
  • 24
  • 68
  • 74
236
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
  • 3,755
  • 4
  • 23
  • 33
169
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 is their respective use and how do they compare?
Axel Fontaine
  • 1,813
  • 2
  • 13
  • 9
144
votes
2 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?
pradeepchhetri
  • 9,621
  • 12
  • 49
  • 59
132
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…
ihatetoregister
  • 3,855
  • 4
  • 19
  • 15
83
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 works1 (the work-flow and responsibilities of each elements). 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…
Pierre-Jean
  • 2,117
  • 1
  • 14
  • 17
66
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,079
  • 1
  • 9
  • 15
64
votes
2 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…
user17537
  • 749
  • 1
  • 6
  • 3
58
votes
7 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
  • 801
  • 1
  • 8
  • 8
52
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…
sherrellbc
  • 2,401
  • 7
  • 22
  • 40
44
votes
2 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
  • 4,078
  • 4
  • 26
  • 42
42
votes
4 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…
MathematicalOrchid
  • 5,348
  • 7
  • 34
  • 57
42
votes
4 answers

How to switch between tty and xorg session

My xorg session is on tty1 and if I want to issue a command from tty (because I cannot do it from xorg session for some reasons), I press Ctrl+Alt+F2, for example, and type a command. But I cannot start graphical applications from any tty except…
itun
  • 637
  • 2
  • 6
  • 8
40
votes
1 answer

What happens when Ctrl + Alt + F is pressed?

I am looking for an explanation of what happens in Linux when this key combination is pressed to change the current terminal. In particular, what software component intercepts this key combination and changes the terminal? Is it the kernel? If it…
user31765
  • 547
  • 5
  • 7
40
votes
3 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…
newenglander
  • 573
  • 2
  • 5
  • 7
1
2 3
59 60