14.5 C
Texas

This is the difference between terminal, console, shell and command line.

Hello! working in text mode, Manage from the command line, Open the console. All of them are expressions that refer to similar concepts and that we tend to confuse and intermingle. Certainly, the environment beyond the typical graphical interfaces is confusing enough for novices. Therefore, it is not advisable to dive into it without having a clear understanding of the concepts. Next, we will learn the difference between terminal, console, shell and command line.

Terminal (emulator)

The terminal itself is a physical device that allows inputting and receiving information from a computer. The most important thing is that it is not necessary for the processing of instructions and data to be carried out on the terminal itself.

Certainly, in today’s world, it is common to interact with the operating system in text mode. Well, in most cases, we will not refer to this meaning of terminal. In fact, the correct term refers to the so-called terminal emulators. These allow us to use text mode within a graphical user interface. This other class of terminals are merely applications that run and give us access to a shell. In fact, they usually allow multiple shell types to be used. This is the case, for example, of Windows Terminal. By default, we will be able to manage the following: Windows PowerShell, PowerShell, Command Prompt, Azure Cloud Shell, the multiple distributions we have installed in the Linux Subsystem (WSL), etc.

On the other hand, Windows Terminal is not the only Windows terminal emulator. Indeed, there are MobaXterm, Cmder, ConEmu and others. However, in the case of Unix-based systems (Linux, *BSD, macOS), the catalog of available terminals is multiplied to infinity. In fact, each desktop environment usually offers its own (Gnome Terminal in GNOME, Konsole in KDE, iTerm in macOS…). But it is also possible to install third-party alternatives for all tastes (Terminator, Alacritty, Guake, st…).

- Advertisement -

Each terminal emulator differs by offering its own graphical interfaces, functionalities, and configuration options. For example, keyboard shortcuts, font and background customization, clipboard management, etc.

Consola [Virtual]

Console is a term that is often used inconsistently. In fact, even more so than the other terms in this list. Additionally, multiple definitions are available on the Internet. In fact, the discrepancies start even in the origin of the word. For some, the old physical console is exactly the same as a physical terminal. On the other hand, others introduce certain nuances, considering the former as a subset of the latter.

What happens when we talk about virtual console? What happens when we talk about virtual console? Many sources consider it, also, synonymous with (terminal emulator.) However, it would be more correct to refer to it as a shell session. Let’s see, let’s suppose we open a terminal emulator and start typing commands directly. In that case, we are, effectively, using a terminal and a console.

On the other hand, suppose we open two tabs in the terminal emulator, whether they are from the same shell. In that case, we are already using two consoles. It can also happen that we subdivide a tab using tools such as a multiplexer (for example, Tmux), or functions such as split table of Windows Terminal. In such a case, the number of consoles will continue to multiply, even if we are only using a single terminal.

In addition, when using a Linux system, we always have several consoles open (although not visible). We are talking about the so-called ‘TTY’, which we can access with the keyboard shortcut Ctrl + Alt + function key (one per key). Part of them will be graphic consoles. However, the others will be text consoles, each running in parallel with the others. Additionally, all of them working outside our graphical environment, so we would not be using them from terminal emulators.

Shell

We have already mentioned, when talking about terminals, several examples of different shells that can be found in Windows. As with terminals, the number of shells in Unix systems multiplies. Certainly, Bash is usually installed as the default shell. However, it is possible to change it for different ones, such as the very popular Zsh. Remember that macOS ended up adopting it as a default shell. Other options include the emerging Fish, the old Ksh and Tcsh, or minority options such as Xonsh.

The function of the shell is to interpret the commands we enter. You might think that there can’t be much difference in how some commands are interpreted. However, there are many variables to watch out for. For example, the different syntax of the scripts, or aspects such as the possibility of creating aliases and defining variables. Also, the existence of syntax highlighting or auto-completion functions. Likewise, the way in which the system output is displayed on the screen. Well, all these elements can make the user experience vary significantly depending on which shell we use.

Command interpreter (or command line)

Every shell is a command interpreter. However, not every shell is a shell. A command interpreter (also called CLI), is any software that interacts with us through the input of text commands. Some CLIs run on top of a shell and are not intended to be a way to control the operating system. Instead, they aim to be just a very specific software or online service. Examples of this can be NPM, IPython, GitHub CLI, AWS CLI or our favorite SSH client. Very well, in this way we have made clear the differences between terminal, console, shell and command line. Bye!

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article