Introduction to Bash

Learn what Bash is, its history, why it matters for system administration, and how it compares to other shells. Get started with the Linux command line.

📖 3 min read📅 2026-02-10Getting Started

What is Bash?

Bash (Bourne Again SHell) is the most widely used Unix/Linux shell and command language. It's the default shell on most Linux distributions and was the default on macOS until Catalina (which switched to Zsh).

Bash serves two purposes:

  1. Interactive Shell — A command-line interface where you type commands
  2. Scripting Language — Write scripts to automate tasks

A Brief History

  • 1971 — Thompson Shell (the first Unix shell)
  • 1977 — Bourne Shell (sh) by Stephen Bourne at Bell Labs
  • 1978 — C Shell (csh) by Bill Joy at UC Berkeley
  • 1983 — Korn Shell (ksh) by David Korn at Bell Labs
  • 1989Bash by Brian Fox for the GNU Project (free replacement for sh)
  • 2019 — macOS switches default to Zsh

Bash combines the best features of sh, csh, and ksh while adding its own improvements.

Why Learn Bash?

  • Ubiquitous — Available on virtually every Linux/macOS/Unix system
  • Server Management — Most servers run Linux; Bash is how you manage them
  • DevOps Essential — CI/CD pipelines, Docker, Kubernetes all use Bash scripts
  • Automation — Automate backups, deployments, system maintenance
  • Text Processing — Powerful tools for processing logs, data, and configurations
  • Career Growth — Required skill for SysAdmin, DevOps, SRE, and Cloud roles

Bash vs Other Shells

FeatureBashZshFishPowerShell
Default on LinuxSomeNoNo
POSIX compatible
Tab completionGoodExcellentExcellentGood
Syntax highlightingNo (default)PluginBuilt-inPlugin
ScriptingStrongStrongDifferentStrong
Pipeline typeTextTextTextObjects
Learning resourcesAbundantGoodGrowingGood

Key Concepts

Before diving in, here's what you'll learn:

  1. Commands — Built-in commands and external programs
  2. Files & Directories — Navigating and managing the filesystem
  3. Pipes & Redirection — Connecting commands and redirecting output
  4. Variables & Environment — Storing data and configuring the shell
  5. Scripting — Writing automated scripts with logic and loops
  6. Text Processing — Using grep, sed, awk, and other tools
  7. Process Management — Managing running processes and jobs
  8. Regular Expressions — Pattern matching and text manipulation

The Terminal vs Shell vs Console

These terms are often confused:

  • Terminal (Terminal Emulator) — The window/application (e.g., GNOME Terminal, iTerm2, Windows Terminal)
  • Shell — The program that interprets your commands (Bash, Zsh, Fish)
  • Console — Historically, the physical hardware; now often used interchangeably with terminal

When you open a terminal application, it launches a shell (usually Bash) inside it.

What You'll Build

By the end of these tutorials, you'll be able to:

  • Navigate the Linux filesystem efficiently
  • Write Bash scripts to automate system tasks
  • Process text data with grep, sed, and awk
  • Manage processes and system services
  • Create cron jobs for scheduled tasks
  • Write deployment and backup scripts
  • Handle errors and debug scripts

Let's start by setting up your Bash environment!