Shell Scripting: Introduction to Shells

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


A shell is a command interpreter that exposes an interface to the underlying operating system.

It allows you to execute operations using text and commands, and it provides users advanced features like being able to create scripts.

There are many different kinds of shells. This lesson focuses on Unix shells, the ones that you will find commonly on Linux and macOS computers.

Many different kinds of shells were created for those systems over time, and a few of them dominate the space:

  • Bash - The most widely used shell, default on most Linux distributions
  • Zsh - Default on macOS since Catalina, with many enhancements over Bash
  • Fish - A user-friendly shell with great defaults and auto-suggestions
  • Csh/Tcsh - C-like syntax, popular in some Unix environments

All shells originate from the Bourne Shell, called sh. “Bourne” because its creator was Steve Bourne.

Bash means Bourne-again shell. sh was proprietary and not open source, and Bash was created in 1989 to create a free alternative for the GNU project and the Free Software Foundation. Since projects had to pay to use the Bourne shell, Bash became very popular.

Bash is (as of today) the de facto shell on most systems you’ll get in touch with: Linux, and the WSL on Windows 10.

Note: macOS since Catalina (fall 2019) uses Zsh as the default shell.

Setting Your Default Shell

You can set your default login shell by running:

chsh -s /bin/bash

For Zsh:

chsh -s /bin/zsh

For Fish:

chsh -s /usr/local/bin/fish

Getting Started

When you open your terminal:

  • On macOS, open the Terminal app
  • On Linux, open your terminal emulator
  • On Windows, use WSL (Windows Subsystem for Linux)

As soon as you start it, you should see a prompt (which usually ends with $).

How do you know which shell is running? Try typing echo $SHELL and pressing enter to see the path to your current shell.

Or for Bash specifically, type help to see the Bash version and available built-in commands.

Lessons in this unit:

0: Introduction
1: ▶︎ Introduction to Shells
2: Bash Basics
3: Writing Shell Scripts
4: Variables and Environment Variables
5: Loops and Arrays
6: Shell Script Functions
7: Creating Aliases
8: Tips and Tricks
9: The Fish Shell
10: Persist aliases and other configuration in Fish Shell
11: How to add a path to Fish Shell
12: Fish Shell, how to avoid recording commands to history
13: Fish Shell, how to remove the welcome message
14: How to replace all filenames with space with underscore using a shell script
15: How to update all npm packages in multiple projects that sit in subfolders