Bash for Mere Mortals
Plain-language guides to Bash — the shell behind most of the world's servers, scripts, and automation glue — written for people who live in terminals but never formally learned the language. No CS degree required.
No jargon without an explanation. No "it's simple, just..." Every concept starts with the idea, then the commands.
One honest note up front: Bash is not a designed language so much as forty years of accreted history. Quoting rules are subtle, error handling is opt-in, and whitespace can be load-bearing. These guides teach the safe modern subset and mark the traps — because a Bash script that "mostly works" is how 2 AM pages are born.
Start here
- What Bash Is — what it is, where it lives, and why learn it.
- Installing Bash — it's probably already there; Windows and Mac notes included.
- Your First Script — shebang,
chmod +x, and running it, with checks along the way.
The building blocks
- Variables and Quoting — the quoting rules that prevent 90% of Bash bugs.
- Control Flow —
if, loops, andcase. - Functions and Arguments — organizing scripts and handling inputs.
- Pipes and Redirection — stdin, stdout, stderr, and chaining commands.
- Text Processing —
grep,sed,awk: the classic trio. - Error Handling —
set -euo pipefailand exit codes: making scripts fail loudly.
Reference
- Troubleshooting — error messages and common gotchas, plain fixes.
- Glossary — quick definitions, A to Z.
Writing criteria
Every guide follows the same writing criteria: plain words, no hype, honest limits, and checkable steps.