code q&a
Resources About
Question:

What is a shell?

A shell is the program that reads the commands you type and runs them. Typing ls and pressing enter tells the shell to list the files in the folder you’re in. It runs the command, shows you the result and then waits for the next one.

People mix up the shell with the terminal because you usually use them together. The terminal app just shows the window and you can run lots of different shells inside it.

Some of the most popular shells are bash, zsh and fish. Macs use zsh by default, many Linux systems use bash and Windows comes with PowerShell. They all do the same basic job but each one has its own extras, like smarter autocomplete or nicer colors.

Shells also let you write scripts, which are files full of commands you can run in one go. A script saves you from typing the same five commands every time you set up a project. Your shell also passes environment variables to every app you start from it, so those apps can read values like an API key.

I used plain bash for the longest time. Eventually I switched to zsh with Oh My Zsh because it’s batteries included. It’s an add-on for zsh that comes with themes, plugins and handy shortcuts already set up.

You might also like