# Bash Resources

Curated, and every link verified as live on 2026-07-18. Knowledge for lessons is drawn from here rather than from recall. Ruthlessly pruned — rejected sources are listed at the bottom with reasons, because knowing what *not* to read is half the value in a topic this full of bad tutorials.

## Knowledge

### Keep these open

- [GNU Bash Reference Manual (Edition 5.3, May 2025)](https://www.gnu.org/software/bash/manual/bash.html)
  The primary specification. Use for: settling what bash *actually* does — quoting, `[[ ]]`, parameter expansion. Not a teaching text.
- [Greg's Wiki — BashGuide](https://mywiki.wooledge.org/BashGuide)
  Nine chapters, zero assumed knowledge, correct habits from line one. Use for: the linear read-through, if you prefer a wiki to a book.
- [Greg's Wiki — Bash Pitfalls](https://mywiki.wooledge.org/BashPitfalls)
  65 real broken snippets and why each breaks. Use for: when a script misbehaves on a filename with a space — the bug is nearly always in here.
- [Greg's Wiki — BashFAQ](https://mywiki.wooledge.org/BashFAQ)
  122 task-shaped answers. Use for: when you know what you want to do but not the safe idiom.
- [BashFAQ/105 — why `set -e` doesn't do what you expect](https://mywiki.wooledge.org/BashFAQ/105)
  Use for: before you copy `set -euo pipefail` out of a CI file. See the honest caveat in Gaps below — this one is contested.

### Tools that teach while you use them

- [ShellCheck](https://www.shellcheck.net/) · [source](https://github.com/koalaman/shellcheck)
  Static analysis for shell — flags quoting, portability, and semantic bugs. **Already installed locally.** Use for: every script you write or inherit.
- [ShellCheck wiki — index of every check](https://github.com/koalaman/shellcheck/wiki/Checks)
  One page per warning code, each with broken code / correct code / rationale. Use for: turning a warning into a lasting rule. This is a de-facto curriculum.
- [explainshell.com](https://explainshell.com/)
  Decomposes any command line against the man pages, flag by flag. Use for: the opaque one-liner in a Dockerfile or install script. The best single tool for the read-others'-scripts strand.

### Structured learning

- [_The Linux Command Line_, William Shotts — free PDF](https://linuxcommand.org/tlcl.php)
  596 pages, shell basics through scripting. Use for: the gentlest on-ramp from a standing start. Chapters 1 and 5 back lesson 01.
- [MIT — The Missing Semester of Your CS Education](https://missing.csail.mit.edu/)
  Video lectures plus exercises. Use for: the automate-my-workflow strand — the only source here that treats the shell as part of a toolchain rather than as a language.
- [OverTheWire: Bandit](https://overthewire.org/wargames/bandit/)
  A wargame for absolute beginners where every level is solved by SSH-ing in and using shell tools. Use for: the servers-and-deploys strand. Makes SSH and pipelines muscle memory instead of theory.

### For decoding other people's scripts

- [Google Shell Style Guide](https://google.github.io/styleguide/shellguide.html)
  Use for: calibrating what good shell looks like — and for its hard limit: past 100 lines or non-trivial control flow, rewrite it in a real language.
- [Docker — Dockerfile reference](https://docs.docker.com/reference/dockerfile/)
  Use for: when a Dockerfile command behaves differently than the same line in your terminal. The answer is usually "exec form — no shell was invoked, so nothing expanded."
- [GitHub Actions — workflow syntax](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax)
  Use for: when a step passes locally and fails in CI. GitHub silently runs `bash --noprofile --norc -eo pipefail`, and those flags are usually why.
- [OpenSSH manual index](https://www.openssh.org/manual.html)
  Use for: `~/.ssh/config` — host aliases, per-host keys, `ControlMaster` connection reuse. The highest-leverage config file for the deploys strand.

## Wisdom (Communities)

- [r/bash](https://www.reddit.com/r/bash/)
  **Start here.** Explicit "Help" flair, beginners engaged with seriously, and script review ("is this idiomatic?") is welcome — which Stack Exchange tends to close as off-topic.
- [Unix & Linux Stack Exchange — bash tag](https://unix.stackexchange.com/questions/tagged/bash)
  ~27k questions. The best place to *ask a real question*. Answers from actual shell maintainers; culture rewards correctness over speed. Will close a vague question — bring a minimal reproducible example.
- [Stack Overflow — bash tag](https://stackoverflow.com/questions/tagged/bash)
  ~157k questions. **Best for searching, worst for asking** — new beginner questions get duplicate-closed fast. Treat as a read-only archive.
- [#bash on Libera.Chat](https://libera.chat/guides/connect)
  The regulars here wrote BashFAQ and Bash Pitfalls. Highest signal anywhere, real-time, webchat needs no client. Blunt: it will tell you your approach is wrong rather than answer what you asked. Go when stuck on something subtle and you can take direct correction.
- [r/commandline](https://www.reddit.com/r/commandline/)
  **Not a Q&A forum.** Tool announcements and dotfiles. Use for: discovering tooling (`fzf`, `rg`, `jq`) that serves the automation strand. Don't post help requests.

## Gaps

Where this mission is genuinely underserved. These drive future search, and some need me to build the material.

1. **No guide to _reading_ a script.** Everything above teaches you to write bash. Nothing teaches walking into a 400-line `install.sh` and decoding it systematically. explainshell handles single lines only. Workaround to teach: ShellCheck first (its warnings map to the author's real mistakes), then `bash -n` to syntax-check without running and `bash -x` to trace. **This is mission strand #2 — I'll need to build this lesson from scratch.**
2. **`set -e` has no beginner-safe resolution.** Wooledge says don't use it; GitHub Actions imposes `-eo pipefail` by default; Google's guide and most real scripts use it. No authoritative source adjudicates this for a newcomer. Teach the disagreement honestly rather than picking a side and pretending it's settled.
3. **No current, authoritative SSH _tutorial_.** OpenSSH man pages are reference, not teaching. Bandit gives practice without theory. Nothing free and maintained covers key management, agent-forwarding risk, and jump hosts for beginners.
4. **Deploy-over-SSH is unaddressed.** Idempotent remote scripts, safe restarts, rollback, secrets handling — the good material lives in Ansible/systemd docs, i.e. tools that exist *because* bash is the wrong answer past a certain size. Worth teaching as a boundary, not a gap to paper over.
5. **CI shell semantics are scattered.** Why one line behaves three ways across your terminal, a Docker `RUN` layer, and a CI `run:` step requires stitching three vendor docs together.
6. **Nothing bridges one-liners to maintainable automation.** Google says rewrite past 100 lines but not into what or how. This is exactly where strand #1 will stall.

## Rejected — do not use

- **wiki.bash-hackers.org** — domain dead since ~April 2023, DNS no longer resolves. Still all over search results and old answers. A [community archive](https://flokoe.github.io/bash-hackers-wiki/) exists; third-tier, strictly behind Greg's Wiki.
- **guide.bash.academy** — 7 of 11 chapters still "todo". The site itself concedes BashGuide is more complete.
- **redsymbol.net "Unofficial Bash Strict Mode"** — expired TLS certificate, and its central advice is contradicted by BashFAQ/105.
- **Mozilla OpenSSH Guidelines** — good content, 2017 copyright, no update signal. Stale.
- **TLDP "Advanced Bash-Scripting Guide"** — ranks highly in search, teaches patterns ShellCheck and the wooledge community both flag as wrong. Actively harmful for a beginner.
