DEV Community

Sloan the DEV Moderator
Sloan the DEV Moderator

Posted on

Explain the difference between shell, console, terminal, command line, etc. like I'm five ๐Ÿ‘ถ

This is an anonymous post sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough posts to write. Email sloan@dev.to if you'd like to leave an anonymous comment.

Top comments (11)

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

Collapse
 
pedrohasantiago profile image
Pedro S

Trying to explain as if you're really 5 yo (ok, maybe 7):

  • Shell is a computer program. A computer program is like a robot: it does stuff it was programmed to do;
  • But we can't actually talk to the robot, it's not close to us. We talk to the robot with a computer in a command line interface: instead of pointing and clicking with the mouse, we write commands and read a response back from the robot;
  • We don't write the commands anywhere. It won't work if we write the commands in Google Chrome, for example. We have to write them in a program called console or terminal. This program will deliver the commands to the shell.
Collapse
 
tux0r profile image
tux0r

A terminal can be its own hardware - originally, it always was. Today's "terminals" are mostly terminal emulators.

Collapse
 
mondirhallouli profile image
Mondir Hallouli

Hey, thanks for the explanation, so basically:

-The SHELL is a robot-like program.

-to talk to this robot you have to use a "translator" where you can write commands, and that's the COMMAND LINE.

-this "translator" needs a tool where you can actually write the commands. That's the TERMINAL(in an OS) or a CONSOLE(in a browser).

P.S.: A command line is within the terminal or console, so it's more like a concept

Collapse
 
ignoreintuition profile image
Brian Greig

Nailed it

Collapse
 
jayzyme profile image
John Barron

Nothing useful to add but Nested Software I love that explanation, I coded back in the late 70's and early 80's. Those flashing green prompts and BASIC language bring back memories. Oh and Disco rocks. I loved to Dance the Night Away!

Collapse
 
aswathm78 profile image
Aswath KNM

Console, terminal, command-line all are same.

like this one

All of them mean the same thing in different operating systems. A non-GUI way to use pc

for example "Double-click" on a file in Ubuntu is equal to

xdg-open filename

in command line or console or terminal

Shell is a software/language to talk to terminal

like

pwd - print directory name
mkdir - make or create a new directory 
Collapse
 
mccurcio profile image
Matt Curcio • Edited

Pardon me but I am new here.
May I say, I have found the 'historical arguments' get lost on kids. When the little whiper-snappers hear that computers are better now they say,

'Why don't they just fix the computers now to run 'Windows'.

The argument for not using 'Windows' on big servers is no longer due to the lack of band-with or the equivalent.

The description I give now is this.

Yes, little Johnie, it is true that big computers could run Windows if they really wanted to but there is another reason.

Have you ever noticed at home when you run 4 games and google and chat your computer gets slow? The largest part of what your computer does is make pretty windows, pictures and colors. It spends a lot of energy and time drawing all those pictures.

Well many scientists don't want to have their computer slow down because of windows, pictures and colors so they communicate with the computer using only word commands. Then the computer scientists have the computer spend all of that time and energy on their programs instead. Use all the computers power on the problem at hand, not the extras.

Collapse
 
rsprinkle profile image
rsprinkle

The console is/was the master terminal on large systems. If you directly logged into a server today, from the attached keyboard (kvm, etc) that is the console.