whatis bash

Bash

Also known as: Bourne Again Shell

The GNU Bourne Again Shell, the default interactive shell and scripting language on most Linux distributions.

What Is Bash in Linux?

Bash is a superset of the POSIX shell with arrays, [[ ]] tests, brace expansion, command history, and tab completion. It reads ~/.bashrc for interactive shells and ~/.bash_profile for login shells.

Most shell scripts on Linux target bash with a #!/usr/bin/env bash shebang. Adding set -euo pipefail near the top makes scripts stop on errors and unset variables instead of silently carrying on.

Example

#!/usr/bin/env bash
set -euo pipefail
for f in *.log; do gzip "$f"; done