BASH
Platform Ops Glossary Bash
Fundamentals, Kernel & Shell · Term #5

Bash

The Bourne Again SHell — the default interactive shell and scripting language on most Linux distros.

Category
Fundamentals, Kernel & Shell
Complexity
Beginner
Glossary Entry
#5 of 190
ShellEnvironment VariablesShell ScriptingShellEnvironment VariablesShell Scripting
What Is It

The Short Answer

Bash (Bourne Again SHell) is GNU's rewrite and superset of the original Unix Bourne shell (sh). It's been the default shell on most Linux distributions for decades, and adds features the original Bourne shell lacked: arrays, better string manipulation, command history, and tab completion.

Being a "superset" matters: scripts written for plain POSIX sh generally run fine under bash, but bash-specific syntax (double bracket tests, arrays, [[ ]]) won't run under stricter POSIX shells like dash.

How It Works

Under The Hood

Bash reads different startup files depending on how it's invoked. A login shell (like an SSH session) reads /etc/profile then ~/.bash_profile. An interactive non-login shell (opening a new terminal tab) reads ~/.bashrc. A non-interactive shell (running a script) reads neither by default — which is exactly why aliases defined in .bashrc don't work inside scripts.

This distinction trips up almost everyone at least once: editing .bashrc and wondering why a new SSH login doesn't see the change (because SSH logins are login shells, which read .bash_profile, not .bashrc — though most distros' default .bash_profile sources .bashrc for you).

In Practice

Example Commands

bash basics
bash --version
source ~/.bashrc
# reload rc file into current session without logging out
echo $BASH_VERSION
Watch Out For

Common Mistakes

⚠️Editing .bashrc and expecting a cron job or systemd service (both non-interactive) to see the new environment variables or aliases.
⚠️Using == for string comparison in a POSIX [ ] test — that's a bash extension; POSIX-strict scripts need =.
VA
Vishal Abhinav
Platform Ops Engineer · Linux & Unix Glossary