Photo by Lavi Perchik on Unsplash

The Command Line || Terminal || Console || Shell

The command line, terminal, shell, console(more on the differences later) is possibly the most misunderstood tool between the technical and nontechnical world. That is almost entirely due to hollywood portrayals of ‘hackers’ slamming their keyboards while sweating and finally sitting back and saying, with a sigh, “I’m in the mainframe”, or something along those lines.

I couldn’t even find a picture of the command line from the unsplash database for the header image of this post. I had to settle with the program code you see, and to find it I searched, “hacking”.

Don’t get me wrong, this is not a rant or even a soapbox. In fact, if misunderstanding of the tools programmer’s tools didn’t exist many IT jobs wouldn’t exist either. So for that, I am thankful.

I want to point out that an early misconception, that the command line is much faster than the GUI(graphical user interface — pointing and clicking with the mouse). Both tools have their place it is important to note that while anything done with a mouse and clicking can be done through executing commands via the terminal, but the reverse is not true. ALSO, there are some tasks that are just faster or more simple with the mouse, think of dragging and dropping.

This post will hopefully make the fuzzy parts of this tool(s) a little more clear, as a first step towards working more efficiently with computers. I am not going to get into a list of helpful commands; maybe in a later post. I just want to give a brief introduction to a crucial tool.

Even amongst many technical professionals the lines between these entities are smudged and may use the terms interchangeably. Even though, generally speaking, if you use any of these terms others will know what you are talking about you must take it upon yourself to be as correct as possible.

Here is a link to a great discussion over the differences and as you will see the answers, while all playing the same game are taking slightly different positions. If you’re not up for a long read then my below explanations will suffice.

Command Line

The command line is simply the line where commands are entered. In the picture above it is denoted by the red “$” on the left. I have customized the look of mine a little so the colors and the information displayed may not match up exactly if you search for another example. You can see that I first typed a command to compile a java file, javac practice.java. I pressed enter and the command was executed by the computer.

When the computer finished executing my command a new command line appeared awaiting my next command. I then ran(typed and pressed enter) java Practice. This time there was output to that needed to be relayed to the user so the output was, well, output. Then another new line appeared to await my next command.

Terminal

Or ‘terminal emulator’, is the software that allows the user to interact with the computer at a basic level. To execute commands, navigate directories, rearrange/rename files and much else.

This might be news to some of us but there was a time before a mouse and a desktop(aside from the top of a desk) existed. Users had to use the keyboard and computer monitor to navigate a computer and enjoy the benefits it offers. So it might help if we think of the terminal as this before-time. If you like circles then you think that, the terminal emulator is emulating that time.

Console

This is a great time to bring up the console. The console is probably the easiest to get a hold of. That is because it is the physical parts of your machine working in conjunction; see what we did there.

Think of your monitor, keyboard, mouse, maybe a detached camera. It can be this and it can be subjective since some of those objects, mouse and webcam, are not necessarily required for the operation of the computer. It is enough to think of console as being the hardware working in conjunction.

Shell

The shell could be thought of as the go-between for the user and the core computer functions being executed. As with all of the terms described there is much more than what we will describe in this post and possibly more so than the others with the shell.

Computers operate with a series of switches being either on or off — 0 or 1. 0(zero) being off and 1(one) being on. This isn’t easy for humans to understand or type. So we have the shell.

The shell takes the input we type via the command line/terminal or programming language and communicates it to computer in a way that the computer can handle it. The cpu then sends that information back to us through the shell and eventually on our screen in the terminal.

I hope this helps anyone wanting a first look into this topic. No doubt my descriptions have caveats that can be pointed out with a more pedantic eye, and I mean that in a positive way. Computers can and should hearken to exactness and it is always better to be more right than less right. All that I mean is that I hope that reading through this has given you a better understanding of some, at times, very subtle differences.

If you have further questions feel free to reach out to me via email or Github, as always.

I love code! I love riddles! I love logic! Please reach out to me in regards to any of these topics.