DEV Community 👩‍💻👨‍💻

Cover image for The Difference Between the Shell and the Terminal
Manik
Manik

Posted on • Originally published at blog.cloudaffle.com

The Difference Between the Shell and the Terminal

Whenever we give commands to a computer to perform a specific task using text, we refer to it as using the command line interface. When using a command line interface, we use text commands to make our programs work instead of a Graphical User Interface. Using the command line is a different way of interacting with the computer. In the Linux world, when we refer to the command line interface, we refer to a shell and, in most cases, to a bash shell. But often, we use a program to interact with the shell, called a terminal emulator. The shell and the terminal are different from each other but are often used interchangeably.

Understanding The Shell

In one of our previous articles in this series, we discussed what an operating system is and why Linux Operating Systems Are Called Distributions. We know that the kernel is the most crucial component of the operating system. The kernel recognizes all the physical hardware on a computer and enables each component to speak to one another. At the root, the kernel grabs the instructions passed to it and gets them processed by the hardware.

The shell interacts directly with the kernel

The user does not interface with the kernel directly. There is a program called the shell between the user and the kernel, which is responsible for taking the inputs from the user and passing them on to the kernel. Simply put, the shell is a program that takes commands from the keyboard and gives them to the kernel to perform. It acts as an interface between the user and the kernel.

The Bash Shell

Most of the Linux distributions come with a shell called the bash shell. Bash is originally the GNU Project shell and was inspired by and built to mimic the original Unix shell program, sh, written by Steve Bourne. Since it was highly inspired by the sh, which was written by Steve Bourne, the folks at the GNU project decided to name the new shell bash, which is an acronym for Bourne Again Shell.

Many alternatives to the bash shell can be used with the Linux kernel, such as ZSH (ZShell), Fish, KSH (Korn Shell), etc. Different shell programs offer different features, but the basic commands and how to interact with the shell remain the same.

The Terminal (Emulator)

Different distributions of Linux come with a Desktop Envornioment installed with it, such as Ubuntu. Ubuntu's Desktop Environment is a modified version of GNOME which stands for GNU Network Object Model Environment. GNOME is a graphical user interface (GUI) and set of computer desktop applications for users of the Linux operating system. When using a Graphical User Interface (GUI) such as GNOME, you need software that can interact with the shell and pass commands that the kernel can execute. This program is called an emulator because it emulates the shell environment for you on your desktop interface.

the terminal emulator in Ubuntu Desktop Environment

Terminal software is a perfect example of an emulator. Terminal ships by default with the Ubuntu Desktop environment and can be used to access the shell. Many emulators are available, and the terminal is just one of them. What is essential to understand is that the emulator is not the shell. It's just a piece of software that enables you to emulate and communicate with the shell in your desktop environment.

What Can You Do Next 🙏😊

If you liked the article, consider subscribing to Cloudaffle, my YouTube Channel, where I keep posting in-depth tutorials and all edutainment stuff for software developers. You can also follow me on Hashnode; my profile handle - @Cloudaffle. Leave a like if you liked the article; it keeps my motivation high 👍.

Top comments (18)

Collapse
 
steve_poling profile image
steve poling

It may be helpful to establish context by recalling the state of computing in the 1970s when all these things were new. You'd hook up a computer to a separate device. This could be anything like a teletype machine located in another city to a CRT/keyboard like the ADM-3 "dumb" terminal. Or a VT-100 "smart" terminal. These differed in the extent to which they could interpret special characters from the computer to change placement and (much later) color. Today the Gnome terminal, MacOS ITerm2, or Microsoft Terminal support much "smarter" operations, but they are just evolutionary steps from the humble beginning of a teletype typing onto a scroll of paper.

Collapse
 
manikbajaj profile image
Manik Author

Thanks for that insight! On the surface it seems we have traversed a long journey but behind the scene it's the core computing hasn't changed much. If you understand how things work behind the scenes it's very easy to add it up.

Collapse
 
raibtoffoletto profile image
Raí B. Toffoletto

Nice article! Kudos for keeping it simple. But I think you could also have mentioned TTYs, those are the first layer of emulations over the shell =D

Collapse
 
manikbajaj profile image
Manik Author

Very good point, was just wondering that I'll take it too far as many developers won't even relate to TTYs. So just stuck to the environment that most of us are used to working. But great to hear from you appreciate the in-depth knowledge 👍

Collapse
 
yuridevat profile image
Julia 👩🏻‍💻

This is so interesting, deep knowledge of what is actually going on behind the scene when I as a frontend developwe am interacting with my computer.

Collapse
 
manikbajaj profile image
Manik Author

I agree with you it's very facinating. At the end of the day it all boils down to 0s and 1s 😊

Collapse
 
codewithmmak profile image
Ajaz Khan

This is great article.

Collapse
 
manikbajaj profile image
Manik Author

Thank you 😊

Collapse
 
delta456 profile image
Swastik Baranwal

Thanks for this wonderful explanation!

Collapse
 
manikbajaj profile image
Manik Author

Glad you found it helpful ☺️

Collapse
 
aadarsh10c profile image
ADARSH KUMAR

Thanks for the chapter. This is the first article I read on Dev.to , truly insightful.

Collapse
 
manikbajaj profile image
Manik Author

I'm happy you liked it 😊

Collapse
 
adam_cyclones profile image
Adam Crockett

What’s the difference between a browser and an internet? 🤔 spiritually one cannot exist without the other.

Sorry for my useless unrelated philosophy

Collapse
 
chiragagg5k profile image
Chirag Aggarwal

Thanks for that wonderful explaination

Collapse
 
manikbajaj profile image
Manik Author

I'm glad you like it 😊

Collapse
 
dogsouldev profile image
Javier Fernández

Nice, thks for sharing!

Collapse
 
halesharry profile image
Seeingthebrightside.com

informative thanks for the post. .

Collapse
 
manikbajaj profile image
Manik Author • Edited on

I'm glad you liked it 👍

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. 🛠