Terminal, Console, CLI, shell... Aren't they all the same thing?

Terminal, Console, CLI, shell... Aren't they all the same thing?

Featured on Hashnode

Terminal, Console, CLI, shell... Aren't they all the same thing?

Yes and no (although, in the present day, we do use them interchangeably with the confidence that the other person knows what we're talking about)!

I get these terms mixed up quite a bit, so I wanted to dive deeper into what they are, why we use them interchangeably, and what the true differences are (at least the ones that matter).‌ ‌

TL;DR Breakdown:

What is a Terminal?

At it's core, any input/output device. Our keyboards and mice are terminals. So are our ears and eyes. They are like terminals for sound.

What is a console?

A physical terminal; a physical mechanism by which input can be collected. Thinking about it this way, it's easy to see how we share this word across industries: video game consoles in gaming, mixing consoles in music, and command consoles in aviation/space.

What is a CLI?

CLI stands for Command Line Interface. A CLI is a distinct type of interface that accepts input commands and then executes them once you hit the Return/Enter key.

What is a shell?

A shell is a specialized command line interface; this is what actually recognizes the commands you enter and then tells the operating system to execute them. There are many flavors; cmd is the default shell on Windows, Bash is the default shell on most Linux distributions, and just recently, zsh became the default shell on macOS Catalina.

My mind's blown. Is yours? Mooncake's definitely is.

Mooncake from Final Space saying 'Whoaaaa' in its alien language

Terminal, Console, CLI, and shell: The (Quick!) History Behind the Words

Yes, in order to understand why these terms have morphed into an interchangeable mess, we need to go back to the beginning. Back to the days of mainframes...

This is an image of a woman sitting at a printing apparatus with IBM 360 (specifically Model 40) in the background

IBM 360 Mainframe - Source: System 360 IBM's History

You've probably seen pictures of these things. They took up entire rooms. And they were usually found in large businesses or universities. In fact, I think my college still uses one (because if it still works, why replace it?!).

Mainframes were meant to be used among many different users. Today, we would achieve this by just handing everyone their own personal monitor, keyboard, and mouse. But back then, users shared access through a common endpoint: the terminal. These were specialized stations that had a display (usually a small cathode ray tube TV screen) and a built-in keyboard. They were connected to the mainframe by a cable or phone line.

Woman sitting at Unimatic terminal for United Airline's competing system.

Woman sitting at Unimatic terminal for United Airline's competing system. Source: ComputerHistory.org

Speaking of connections, we get the term console from the actual console port on the mainframe that terminals would connect to. This is how users controlled the mainframe digitally, through these connected terminals scattered around the building.

Ok, so now we're connected. How did users actually interact with the mainframe? If you have seen any "hacker" scene in a movie, you usually see something like this: ‌ Robotic and human hand fake typing on a terminal, with code appearing quickly on the screen

‌(And if you have a minute and 47 seconds to spare, watch this hilarious Ode to Mainframes 😂)

Notice how there are no fancy graphical interfaces just yet? That's because most interactions with mainframes were via simple commands, entered one at a time. And this is where the term and concept of the command line interface (CLI) comes from! Users would supply a command to the mainframe through a terminal. ‌

Alright, home stretch...‌ ‌‌

‌It's important to note that the terminal has nothing to do with the actual processing or interpreting of the command. They are simply a means for the user to input commands (hence the hopefully antiquated term "dumb terminal"). It's actually the shell that accepts and recognizes these commands, sends them to the mainframe to execute, collects the results, and sends it back to the terminal!

Here's the kicker: the shell is really just a wrapper around the kernel. And in an operating system, the kernel is "a computer program that is the core of a computer's operating system, with complete control over everything in the system. On most systems, it is one of the first programs loaded on start-up..." ^1

This is why we call the shell a "shell" as it acts similarly to the piece of material around a corn kernel!

What happened?

Today, most terminals and consoles are represented virtually through software, but as we've learned, they used to be physical, tangible objects. Pairing this history with the fact that they are heavily intertwined with the origins of the command line interface, it's easy to see how the terms "terminal" and "console" have become muddled together! And by the time we reach present day, the use of all of these terms "terminal", "console", "shell", "CLI" eventually became synonymous with the end goal we as developers are trying to achieve: to interact with an operating system and execute specific actions through commands!

Cover Photo by bert brrr on Unsplash

Thank you so much for taking the time to read my blog post! Hopefully these terms aren't so confusing anymore!

If you enjoyed it, please let me know in a comment below. Or even better, if you feel this article was thorough in a good way, please share it/tweet it to spread the knowledge and love. ♥️

For more from me, be sure to follow my blog!

To see what I'm up to, follow me on Twitter!