A tty is a native terminal device, the backend is either hardware or kernel emulated.
A pty (pseudo terminal device) is a terminal device which is emulated by an other program (example:
such programs). A pts is the slave part of a pty.
(More info can be found in
A pty is created by a process through
usually opens the special device
and is constituted by a pair of bidirectional character devices:
The master part, which is the file descriptor obtained by this process through this call, is used to emulate a terminal. After some initialization, the second part can be unlocked with
and the master is used to receive or send characters to this second part (slave).
The slave part, which is anchored in the filesystem as
real name can be obtained by the master through
behaves like a native terminal device (
In most cases, a shell is started that uses it as a controlling terminal.
kernel.pty.max = 5//限制伪终端为3个