tty

R

raj55

Guest
Hi,
What is the usage of realtime of tty?
When execute tty,it shows /dev/pts/2.(what is the meaning of pts)
I can see at /dev/ tty 0 to f.
What is the meaning of each one ttyp0/ttys0?

Br,
Raj
 


This site should explain everything:
http://www.tldp.org/HOWTO/Text-Terminal-HOWTO-7.html
Pseudo terminals are pairs of devices such as /dev/ptyp3 and /dev/ttyp3. There is no physical device directly associated with either of them, not even a serial port connector. But if a program treats ttyp3 like it was a serial port, what is read and written to that port appears on the other member of the pair ptyp3 which another program uses to read and write to. Thus two programs talk to each other via this method and one program on ttyp3 thinks it's talking to a serial port. It's something like a "pipe" between these two tty's.
There are only 16 ttyp's: ttyp0-ttypf (f is a hexadecimal digit). To get more pairs, more letters such as q, r, s are used instead of p. For example the pair ttys8, ptys8 is a pseudo terminal pair. Later on, even more letters were added so as to allow even more pseudo terminals. And when z was reached, they wrapped around to a. This is confusing but old habits are difficult to change. Today Linux allow say ttyp189 but it's not used. The device file system, which was abandoned in 2004, would have used tty/s189. Be sure not to type say ttys2 if you mean ttyS2 (a real serial port)
 

Staff online

Members online


Top