Linked Questions

3
votes
1answer
710 views

How is sudo interrupted in xterm on Ctrl-C? [duplicate]

Please explain in detail (including tty related stuff) how is a sudo foreground process on a X terminal emulator actually killed on the Ctrl-C. See the following example please: $ sudo -u test_no_pw ...
1188
votes
9answers
312k views

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?
80
votes
2answers
19k views

How do keyboard input and text output work?

Suppose I press the A key in a text editor and this inserts the character a in the document and displays it on the screen. I know the editor application isn't directly communicating with the hardware (...
62
votes
2answers
83k views

Why does Ctrl-D (EOF) exit the shell?

Are you literally "ending a file" by inputting this escape sequence, i.e. is the interactive shell session is seen as a real file stream by the shell, like any other file stream? If so, which file? ...
41
votes
6answers
7k views

Does pressing ctrl-c several times make the running program close more quickly?

I often start to read a huge file and then want to quit after a while, but there is a lag from pressing Ctrl+C to the program stops. Is there a chance of shortening the lag by pressing the Ctrl+C key ...
16
votes
1answer
3k views

Who decides which application receives the signal from keyboard?

My current understanding of signals from keyboard in terminal is (based largely on trying to map my observations to what can be found on google) following: User presses C-c This is sent to input ...
5
votes
2answers
3k views

How does Bash get the output of an executed program?

When I execute a program in Bash, for example, [ls][2], it sends its output to standard output (fd &1). And the ouput of the executed program is displayed in the terminal. How does Bash/terminal ...
6
votes
2answers
3k views

What is the TTY major number of your Unix?

I'm currently working on a serial port library which already uses special frameworks to get information about serial ports on the system. Though serial ports are a fundamental design in Unix—as ...
5
votes
2answers
832 views

When does cat finish reading from a pipe?

Given the following code, why does cat only print the contents of the pipe after I've typed \n or CTRL+D? What are the conditions for cat to actually print what it read? #include <stdio.h> #...
5
votes
1answer
308 views

How does the Terminal and the Shell exchange data?

In Linux, a Terminal is associated with a Shell. The Terminal send input to the Shell (for example: pwd), and the Shell send the output back to the Terminal (for example: /home/paul). This diagram ...
4
votes
1answer
252 views

BSD-style pseudoterminals vs. UNIX 98 pseudoterminals

Based on what I have read about pseudoterminals in Linux, there are two types of pseudoterminals: BSD-style pseudoterminals (which is deprecated) and UNIX 98 pseudoterminals. I have created two ...
4
votes
1answer
372 views

Does the process on the slave side of a pty talks to the line discipline or to the slave tty driver?

I have found two contradictory images of how a pseudo terminal (pty) works. The first image shows that the process on the slave side of a pty talks to the line discipline: The second image shows ...
-1
votes
2answers
315 views

documentation on ptmx and pts [closed]

I am want to stream a linux terminal to my own program, and as far as I understand this is done by opening /dev/ptmx to start a new pts, I have tested this and this does indeed work (it creates a new ...
2
votes
1answer
133 views

How does a terminal emulator read and write with a physical terminal device?

In a diagram from APUE, Where is a physical terminal device or virtual console for the terminal emulator read and write with? what process open, read and write with some physical terminal device or ...
1
vote
1answer
218 views

How to prevent octal dump (od) returning?

I am trying to read some output from /dev/ttyUSB0, using od on Ubuntu. So I used this command: od -x --endian=big < /dev/ttyUSB0 When I used it yesterday it was not blocking and just showed stuff ...

15 30 50 per page