TechnologyUnix shell

Bash

Also known as: Bourne Again Shell

Unix shell and command language written for the GNU Project, long the default interactive shell and scripting language on Linux systems.

Bash, the Bourne Again Shell, is a command-line interpreter that reads commands typed by users or stored in scripts and runs them on Unix-like systems. It provides variables, control flow, functions, pipes and redirection for connecting programs, along with interactive conveniences such as command history, tab completion and job control. Bash is largely compatible with the POSIX shell standard and with the Bourne shell it replaced. It is part of the GNU project and licensed under the GNU General Public License.

Brian Fox wrote Bash for the GNU Project and released it in 1989 as a free replacement for the Bourne shell, which Stephen Bourne had written at Bell Labs for Version 7 Unix. Chet Ramey became its maintainer in the early 1990s and has led development since. Bash became the default shell on most Linux distributions and on macOS for many years, until Apple switched the default to zsh in 2019. It is also available on Windows through the Windows Subsystem for Linux.

Bash shell scripting glues together much of system administration, build automation and continuous integration pipelines, and familiarity with it remains a core skill for working on servers. Its syntax is powerful but error-prone, with subtle quoting and word-splitting rules that cause bugs and security problems. In 2014 the Shellshock vulnerability showed how a flaw in Bash's handling of environment variables could be exploited remotely through web servers and other services that invoked it, prompting urgent patching worldwide.

Key points

  • Bash interprets commands and scripts on Unix-like systems.
  • Brian Fox released Bash for the GNU Project in 1989, and Chet Ramey has maintained it since the early 1990s.
  • Apple switched the default macOS shell from Bash to zsh in 2019.
  • The 2014 Shellshock vulnerability showed how shell flaws can be exploited remotely.

Related entries

Technology

GNU

FOSS

Free software operating system project launched by Richard Stallman in 1983 to build a complete Unix-compatible system that respects users' freedom.

Glossary term

Shell Scripting

ProgrammingDevOps

Writing programs for a command-line shell, such as Bash, that automate sequences of commands, file operations and system administration tasks.

Glossary term

Command-Line Interface

ProgrammingFOSS

Text-based interface in which users interact with a computer by typing commands and reading text output rather than using graphical menus.

Technology

Linux

FOSSHardware

Free and open-source Unix-like kernel created by Linus Torvalds in 1991 that underpins Android, most servers and many embedded devices.

Glossary term

Cron

DevOps

Time-based job scheduler in Unix-like operating systems that runs commands or scripts automatically at specified times, dates or intervals.

Glossary term

Vulnerability

Cybersecurity

A weakness in software, hardware, configuration or process that an attacker could exploit to compromise confidentiality, integrity or availability.

Technology

curl

ProgrammingFOSS

Free command-line tool and library, created by Daniel Stenberg, for transferring data with URLs over HTTP and dozens of other protocols.

Technology

OpenSSH

CybersecurityDevOpsFOSS

Free suite of secure networking tools based on the Secure Shell protocol, developed by the OpenBSD project and used for encrypted remote login.

Referenced by

Other entries that discuss or point to Bash.