Let’s explore: what is a shell and terminal?
Tags: mac, shell, terminal, tutorial
Published: 2021-04-15 17:16:22

 ---
title: Let’s explore: what is a shell and terminal?
published: true
date: 2021-04-15 16:53:19 UTC
tags: mac,shell,terminal,tutorial
canonical_url: https://christine-seeman.com/2021/04/lets-explore-what-is-a-shell-and-terminal/?utm_source=rss&utm_medium=rss&utm_campaign=lets-explore-what-is-a-shell-and-terminal
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iw5mxqphsp04alz396gh.jpeg
---

I still feel new to the world of terminals, consoles, and yes, shells. Being a Java engineer for 12 years really didn’t expose me much to these concepts in my day-to-day work, but now as a Ruby on Rails engineer, it is my preferred way of interacting with my tests, servers, git ... With Java, my day was just working in my IDE (Integrated Development Environment) which was Eclipse or pretty much Eclipse (I’m looking at you Spring Tool Suite). Sometimes I really feel like I am out of step when I start hearing folks discuss bash vs zsh or vim vs emacs, admittedly I am not quite sure what a kernel is either.

![](https://media.giphy.com/media/wSCAy1zJbcUG4/giphy.gif)

### What is a shell?

So I thought I would take myself to step one, and answer the question, what even is a shell? It seems like something that is mixed up with a terminal, and frankly I can’t keep them apart. So let’s untangle that mess.

University of Chicago professor [Benjamin Soltoff](https://twitter.com/soltoffbc) has a [great write-up](https://cfss.uchicago.edu/setup/shell/) about this, which summarizes:

> The `shell` is a program on your computer whose job is to run other programs, rather than do calculations itself. The `shell` is a very old program and in a time before the mouse it was the only way to interact with a computer. It is still extremely popular among programmers because it is very powerful, fast, and is particularly powerful at automating repetitive tasks.
> 
> <cite>https://cfss.uchicago.edu/setup/shell/</cite>

So a shell helps with interactions between programs, maybe even programs and the operating system (OS)... clear as mud there. Let's dig deeper, maybe by tracking down the definitions of terminal, and console, it might make more sense.

### What is a terminal?

According to [The Linux Information Project](http://linfo.org/)

> A _terminal window_, also referred to as a _terminal emulator_, is a text-only [_window_](http://www.linfo.org/window.html) in a [_graphical user interface_](http://www.linfo.org/gui.html) (GUI) that emulates a [_console_](http://www.linfo.org/console.html).
> 
> <cite>http://www.linfo.org/terminal_window.html</cite>

Ok. So a terminal allows a user to enter text and use commands through command-line interfaces (CLI) and text user interface (TUI) applications. Some examples terminal apps are iTerm2, Window Terminal, and Linux console.

Ok, so terminal might be the application you open for running commands such as git commands, or booting up your rails server. I know on my system my terminal is iTerm2. Adding in what we now know about shells and terminal, it seems like these two definitely work together. So the terminal is where your shell is used. They are pretty intertwined, in that you can’t really use your shell without a terminal! No wonder people have a hard time breaking them down.

### How do I tell what I am using?

Well in the case of the terminal, what is the application you are opening up? For me, I know because I am hitting the little `iTerm` icon:

![](https://christine-seeman.com/wp-content/uploads/2021/04/image.png)<figcaption>iTerm’s icon</figcaption>

Try searching for “Terminal” on your OS, and see what pops up. The default MacOS Terminal app is usable for when you want to dip your toes finding out what a terminal is about, but lots of devs prefer something a little bit more customizable.

In the case of your shell, you need to boot up your terminal app and put in a command. One to try could be `echo $SHELL` (`echo` is a command to output that argument of `$SHELL` which should correspond to what is our system level shell program). Or give `echo $0` a go. Testing out those commands shows that I am using a bash shell:

![](https://christine-seeman.com/wp-content/uploads/2021/04/image-2.png)<figcaption>Trying out <code>echo $SHELL</code> in my iTerm2 terminal, and getting a <code>/bin/bash</code> result</figcaption>

You might see `zsh` or something else, but don’t worry if you want to change it. There are [many](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH) [resources](https://www.gnu.org/software/bash/manual/html_node/Installing-Bash.html) to help you out.

### But what should I use?

That’s the great thing, it’s up to you! This is one of those programming things that a lot of people have a lot of opinions on. Frankly, I think start using one, and see what works for you. I have been using bash for years, or at least I think it is years, because I can’t recall when I might have installed it so that probably means it has been a while. If you see something that looks interesting in another shell, try it out for a while! Maybe you will find it does help you in some way. If not, at least now you are more familiar with multiple shells.

Here’s some shell options but let me know, what’s your favorite shell and why?

- [Zsh](https://www.zsh.org/) (also called ZShell)
- [Oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH)
- [Bash](https://www.gnu.org/software/bash/)
- [KornShell](https://www.explorelinux.com/install-korn-shell-ubuntu/)
- [Tcsh](https://randomknowhow.com/tech/infrastructure/devops/tutorials/c-shell-tc-shell-install-for-linux-windows-mac/)
- [Fish](https://fishshell.com/)