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 Learn more about Bash
- Writing Your First Bash Script A practical introduction to Bash scripting: the shebang line, variables, arguments, conditionals, loops, and functions, with runnable examples you can adapt for real automation tasks.
- Bash Scripting Part 2: Conditionals, Loops, and Functions Your first script ran commands top to bottom. Real scripts make decisions, repeat work, and organize into functions. This is the control-flow layer of bash: if, test brackets, for, while, case, and functions with local variables.
- Bash Error Handling: set -euo pipefail and Why Your Script Needs It By default a bash script that fails halfway through keeps running as if nothing happened. Three options change that, and knowing exactly what each one does is the difference between safety and mystery.
- Bash Quoting Explained: The Single Biggest Source of Shell Bugs Word splitting and glob expansion on unquoted variables cause more shell breakage than any other single mistake. Here is exactly what each quoting style does and when to use it.
- Bash Arrays and Parameter Expansion Arrays handle lists of things without word splitting bugs, and parameter expansion does substring, default, and pattern operations without launching sed. Both remove whole categories of shell mistakes.