Terminal is the interface through which you type cryptic Linux commands, but is terminal just a window with command prompt on your Linux desktop? Well, the fact is, the terminal you are using now is probably not a real terminal. In this article I will be explaining the real meaning of Linux terminal and console. Understanding this basic concept is important if you want to master Linux.

Terminal is An Interface Between Human and Computer

As a noun, terminal has many meanings. The Merriam-Webster dictionary gives us a good definition of terminal in the computing field:

a combination of a keyboard and output device (such as a video display unit) by which data can be entered into or output from a computer or electronic communications system.

Human and computer are two independent entities. Human need an interface to put information into the computer and read output from it. These days, input device of personal computers includes: keyboard, mouse and microphone. Output device includes monitor and speaker. They are commonly called peripheral devices. But in the Unix and Linux world, input and output devices are called terminal. The opposite of terminal is the host, which includes devices like CPU, RAM, HDD and so on.

So now we have two equations.

Computer = Host + Terminal

Terminal = Input device + Output device

The First Terminal

Personal computers came into daily lives in the late 1970s. Before then, we can only use expensive mainframes and minicomputers in big companies or universities. The PDP-7 minicomputer used by Ken Thompson and Dennis Ritchie (The two creators of Unix) cost 72,000 US dollars in 1965, and the GE-45 mainframe cost 10 million US dollars.

Ken Thompson and Dennis Ritchie wanted to make Unix become a multi-user operating system, which means each user would have a terminal to connect to the computer. Each user needs a monitor and keyboard. However, every computer devices, including monitor, were very expensive in those days. And keyboards were physically attached to computers. There was no detachable keyboards then.

So they found an alternate solution: use the cheap ASR33 teletype as terminal. Teletype (TTY) was mainly used to send and receive typed messages in telegraphy, but they can also be used to put information into computer and get information out from it. You use the keyboard to input information and print output on the paper.

Linux terminal ASR33ASR33 Teletype

Many teletypes were connected to one Unix computer. Every user can log into Unix with their own username and password, sitting in front of their own teletypes. So Unix became the first multi-user operating system and ASR33 became the first Unix terminal. Due to this fact, the acronym TTY is commonly used to represent terminal in Unix/Linux.

Over the years, terminals became more and more advanced. In 1970, DEC (Dgital Equipment Corporation) introduced the VT05 video terminal. It has a monitor with a video screen for output.

VT05 video terminal

Character Terminal vs Graphics Terminal

Character terminal is also known as text terminal, which can only output text-based information. Teletypes are character terminals. The most famous character terminal is the VT100 made by DEC in 1978. It’s designed so well that it became a standard for later terminals.

Graphics terminal is better because it can also show graphics/pictures on the screen. The most famous graphics terminal is X Terminal, which provided the basic support for the X window system.

Linux Terminal Emulators

Now you know terminal is hardware. In the 1970s and 1980s, people type commands sitting in front of a real terminal. These days we often type commands in a software terminal, which is better known as terminal emulator or terminal emulation application. Sometimes people call them virtual terminal. They are not real terminals, but the operating system thinks they are.

If you use Gnome terminal, you can run the following command to read the manual of gnome-terminal.

man gnome-terminal

It tells you that gnome-terminal is a terminal emulation application. It emulates Xterm.

gnome terminal is a terminal emulation application

Xterm is also a terminal emulator. It emulates the VT102 terminal made by DEC. Now you can still find Xterm in your Linux distribution.

What is Console?

In the 1970s and 1980s, terminal are often connected to the host by wire, but there’s a special terminal that is attached to the host. This special terminal is called console. It is used by administrators only. Each computer has only one console. There’s not much difference in appearance between standard terminal and the console, but console can do something that standard terminals can not do. For example, if the operating system failed to boot up, there would be error message displayed on the console, but not on other terminals. And if the operating system boots into single-user mode, you can only use console to login. Other terminals have no permission to login in single-user mode.

PDP-7 minicomputer consolePDP-7 minicomputer console

Console and terminal are often seen as synonyms on personal computers. Your monitor and keyboard are the console, and also terminal. You can switch between a standard user and an administrator at any time.

Virtual Console

As a matter of fact, there are two types of terminal emulator. The first type is terminal window you open in a desktop environment. The other type is virtual console. In the 1970s and 1980s, people can often use only one terminal. Heavyweight people in a company or university can use multiple terminals, because they need to do many things with the operating system. So there would be several terminals on their desks.

Nowadays, we don’t need to put multiple terminals on the desk, because Linux can create multiple virtual terminals. One of them is graphics terminal, the other six is character terminal. The 7 virtual terminals are more commonly known as virtual consoles and they use the same keyboard and monitor. Physical console is the combination of your monitor and keyboard. When Linux boots up, it creates the 7 virtual consoles and by default brings you to the graphics console, i.e, the desktop environment. You can run the who command to check which virtual console you are using.

who

linux virtual console

As you can see, I’m using the 7th virtual console (tty 7). If we want to switch to a character virtual console, simply press Ctrl+Alt+ F1, or Ctrl+Alt+ F2…. Ctrl+Alt+F6. To switch back to the graphics virtual console, press Ctrl+Alt+F7.

When is virtual console useful? If, for some reason, your desktop environment doesn’t respond or the icons/taskbar on your desktop suddenly disappear, you can switch to a character virtual console, and type commands to diagnose the problem.

Note: On Fedora, tty1 is the default graphical virtual console.

#command line #linux

Linux Terminal and Console Explained For Dummies
5.00 GEEK