DEV Community

Discussion on: Explain the difference between shell, console, terminal, command line, etc. like I'm five 👶

Collapse
 
nestedsoftware profile image
Nested Software • Edited

Let's go back to a simpler time. It's the 1970s. Disco is topping the charts around the world. Desktop computers and smartphones don't exist yet. In fact, the most powerful computers around are much less powerful than even a Raspberry Pi or Arduino today!

IBM Mainframe

See this article for example. Even though they lack performance, these computers take up a lot of room! A typical mainframe computer of this time period consists of at least one big refrigerator-sized cabinet, and possibly more.

The mainframe is located in a room somewhere, and as a puny user, you're probably not allowed anywhere near it. Only the high priests known as operators, and their acolytes, are allowed in the room with the actual mainframe. So how do you access it? Well, there's this thing called a "terminal." Terminals (also called "consoles") are basically small cathode ray tube TV screens with a built-in keyboard that are connected to the mainframe by a cable, or possibly even by a phone line. By this point in time, mainframes can generally service more than one user at a time. Each user can connect to the mainframe with his or her terminal. The terminal doesn't have any of the fancy user interface witchery that we know today. It just has a humble "command prompt." The command prompt is usually a symbol, like # and you type in commands that the mainframe will recognize after that symbol. e.g.

# ls
Enter fullscreen mode Exit fullscreen mode

ls is a Unix command that lists the files in the current directory. That's the kind of thing you're able to do at a command prompt, just send individual commands and then read the responses as they slowly scroll in amber or green text across the terminal screen. This is called entering commands at the "command line," because you enter one line of text at a time, then press "enter" and wait for the mainframe to send back a response. By the way, Unix is brand new in the early 70s, though its heritage goes back to even earlier systems like Multics.

The terminal is very simple so it's often called a "dumb terminal," because it relies on the mainframe to do any actual processing. It's just an input/output device, like a keyboard, monitor, or mouse is today.

So what is it that actually processes the commands you send from your terminal to the mainframe? Well, for each terminal, the mainframe launches a small program called a "shell." This program is responsible for recognizing the command that you entered into the terminal. It then runs that command, collects the results, and sends those results back to the terminal. It may also check that you've logged in with a valid username and password before it lets you do anything else.

Now you can see where the terms "terminal," "console," "command line," "command prompt," and "shell" came from. These days these terms are more or less interchangeable. They all just mean that you open up the program, like cmd or powershell in Windows, that lets you enter commands and run scripts. However, there was a time when these terms really referred to different components of the technology that existed at the time.

In fact, I believe that when you open a terminal window in a Linux system these days, the interaction between that terminal window and the actual computer is similar to the way those old fashioned physical terminals worked, even though now it's just another program rather than a standalone physical device.

Collapse
 
vguarnaccia profile image
Vincent Guarnaccia • Edited

I agree with you; they're mostly interchangeable. I would like to point out the term "shell" is also used with any type of repl program, including the terminal and something like the python shell.

Collapse
 
jenc profile image
Jen Chan

Beautiful post, thank you