Terminal, command line, shell and console: are they really different?

Have you ever called the “terminal” a “shell” or a “command line”? Even if you are not wrong to do so, there is are distinct differences between these terms. I’m going to dive into these differences and the origin of the terms; How many can you get right?
What is a terminal?
The word “terminal” is short for “terminal emulator”, a program that mimics the behavior of old-fashioned physical computer terminals. In the early days of computing, users interacted with remote computers through dedicated hardware terminals over a communications link. These terminals were equipped with a keyboard and screen, or in some cases, a printer. Users would use terminals to send commands and display text.
The previous video shows a DEC VT100 computer terminal connected to a restored mainframe.
When personal computers became widespread, operating systems began to emulate hardware terminals in the form of software. This allowed users to interact with remote systems without the need for physical terminal hardware. Today, the legacy of physical terminals continues through terminal emulators, which we use in very similar ways.
A terminal emulator allows you to send commands and receive text to and from a computer; the terminal window is the graphic container that surrounds it. So, technically speaking, the common, modern definition of the word “terminal” in Linux refers not to the window itself but to a simulated device for sending commands and receiving text.
If you’re interested, we have two articles on the history of the terminal. One covers the three eras of Unix terminals and another covers the progression from printing to video terminals.
What is a shell?
A shell is the outermost layer of a system that facilitates user interaction. In an operating system, the shell can take the form of a command line interface or a graphical user interface (GUI). It generally functions as a user-space program that communicates with the system through standard user-space channels, rather than interacting directly with the kernel.
User space is the execution environment for unprivileged processes. All your typical applications (even root applications) run in user space. Kernel space is reserved for privileged code and has absolute power over the rest of the system and direct access to hardware, for example to drivers or kernel components.
In common Linux parlance, shell generally refers to a command line interpreter that accepts commands and scripts to perform tasks on the operating system. It is a program that reads and understands commands and executes them. Examples of typical shells in Linux are Bash, Zsh and fish. Each of these shells has its own way of processing commands and executing scripts.
You may also have heard of the Gnome shell; This is an example of a graphical shell that users interface with to control the system, for example to create and delete files, etc. A graphical shell in Linux will interface with the windowing system and take the form of menus, windows, and other desktop functions.
What is a command line?
A command line (CLI or command line interface) is simply a place to enter commands into a system, usually through a command shell. It’s a universal term, and a command line can exist as part of an operating system or even a program. People often confuse this term with other closely related terms, like terminal or shell, but it has a distinct meaning. This distinction won’t keep you up at night with worry, but it exists.
Two common examples of the command line are the lines of text you type in Bash or Zsh.
Another command line example is found in Emacs, which allows you to enter commands on the fly using Elisp.
What is a console?
The Linux console is an input/output subsystem provided with the Linux kernel. It receives messages and allows interaction with the kernel.
The difference between Linux console and a terminal emulator is that the Linux console driver runs in kernel space, displays system messages, and allows direct interaction with the Linux system. On the other hand, terminal emulators are just programs for sending commands and receiving responses and run entirely in user space. The Linux console also has far fewer modern features than terminal emulators.
The Linux console manages virtual terminals called TTYs (aka virtual consoles). You can interact with the Linux console through these TTYs, found in /dev/tty*, where “*” is a number. Similarly, terminal emulators interface with pseudo-terminals located in the /dev/pts/ directory (e.g., /dev/pts/0, /dev/pts/1, etc.).
TTY stands for ticker tape. Historically, they were electromechanical devices, much like typewriters, capable of sending and receiving electronic messages over a communications line (such as a telephone, telegraph, or serial line). These devices date back to the era of the telegraph (an upgrade of Morse code). Modern Linux systems imitate them.
The previous videos show a teleprinter connected to a Linux server via a serial line. The user issues commands and receives output from the Linux console through serial TTY device nodes (for example, /dev/ttyS0).
Through one mechanism or another, virtual consoles and terminal emulators run a shell, usually Bash. The shells may look similar, but their operational contexts are very different.
You can access an TTY via Ctrl+Alt+F*, where “*” is a number (1-7). Linux distributions typically configure TTY1 to launch the display manager (login screen), which in turn will launch your graphical shell (i.e. desktop environment). Numbers 2-7 are generally available, but returning to TTY1 will take you back to your office.
Use the following command to see which virtual console your login session is attached to.
loginctl session-status
My current session connects to vc1 (aka virtual console 1 or TTY1) as shown in the previous image.
In short, the Linux console is a kernel-level input/output subsystem that can be controlled through a virtual console. These TTY devices have historical roots and imitate teletypewriter devices. It is still possible to send and receive commands to the Linux kernel via teleprinters.
People often confuse these terms, but they have clear technical distinctions. For example, the CLI could rightly refer to the terminal or console. The typo could mean any of these terms. Often people say “open a shell”, but what they really mean is open a terminal. However, you can also complete the designated task through a virtual console.
The correct phrase to use is “terminal window” for most users. You open a graphics window and run commands. The term “CLI” is also valid because it can refer to any command interface (including an Emacs minibuffer). However, if someone asks you to open a console, it’s a very specific request, and so you need to pay attention to the reason.
Now that you know the difference between the different terms, you might be interested in learning Linux terminal as a beginner.




