Fundamentals 14 min read

What Is a Terminal? From Early Mainframes to Modern Linux Device Files

This article explains the concept of a terminal, tracing its evolution from massive mainframe consoles to today’s Linux tty, ptmx, and pts devices, covering physical, remote, and virtual terminals, their role in user interaction, and how login mechanisms like getty work.

Liangxu Linux
Liangxu Linux
Liangxu Linux
What Is a Terminal? From Early Mainframes to Modern Linux Device Files

In everyday Linux use, the term “terminal” often feels vague, but fundamentally it is any device that handles a computer’s input and output: a monitor and keyboard pair, a printer‑typewriter set, or a software program that emulates such hardware.

Historically, early computers occupied entire rooms and featured a single control console similar to a machine‑tool or aircraft cockpit. Operators entered commands at this console, and the machine’s results were displayed there, making it the original terminal.

With the advent of multi‑user, time‑sharing systems, multiple independent terminals were needed. Each user logged in to obtain a dedicated terminal, leading to the concepts of login and software terminals that could run on the same hardware.

Modern terminals fall into three categories:

Local terminals : a VGA‑connected monitor and a PS/2 or USB keyboard.

Remote terminals via serial port : a host connected to another machine’s monitor and keyboard, often accessed through programs like Windows “Super Terminal”.

Network‑based terminals : SSH, Telnet, etc., which use TCP/IP tunnels to convey terminal streams.

Physical terminals directly involve hardware; network‑based terminals do not, and are called pseudo‑terminals . In Linux, device files under /dev represent these terminals: /dev/ttyX (e.g., /dev/tty1/dev/tty63) are local physical terminals. /dev/ttyS1, /dev/ttyS2, … represent serial‑port terminals. /dev/ptmx and /dev/pts/X are pseudo‑terminal master and slave devices used by SSH, Telnet, etc.

The kernel tracks the current “focus terminal” via /dev/console. Writing to /dev/console displays output on the active terminal, while /dev/tty always refers to the terminal of the calling process.

When an SSH client connects, sshd forks a child process, opens a /dev/pts/N device, and pairs it with /dev/ptmx. Data flows through this pipe, is encapsulated in TCP/IP, and reaches the client, effectively creating a remote terminal stream.

Login handling involves the getty program, which prompts for username and password. Upon successful authentication, the user receives a shell (e.g., Bash) on a terminal device ( /dev/ttyX for local logins or /dev/pts/N for SSH).

Understanding these device files and their roles demystifies the seemingly complex landscape of Linux terminals, showing that they are simply interfaces for input and output, whether physical, serial, or virtual.

System InternalsSSHTTYPseudo‑terminalDevice Files
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.