Skip to main content
WebsitebeginnerFree

BashGuide (Greg's Wiki)

by Lhunath (Maarten Billemont) and GreyCat (Greg Wooledge) · Greg's Wiki (mywiki.wooledge.org)

The single best free structural path through Bash, and the explicit community replacement for the discredited TLDP Advanced Bash-Scripting Guide. Teaches correct habits (quoting, [[ ]], arrays) from the first page rather than retrofitting them. Community-maintained guide on Greg Wooledge's wiki covering commands, parameters, globbing, conditionals, arrays, redirection and traps. Its companions BashFAQ and BashPitfalls document the quoting and word-splitting mistakes that silently break most beginner scripts.

Visit resource

More resources on Bash & Shell Scripting

BookFree

Advanced Bash-Scripting Guide

Free book-length guide to Bash scripting by Mendel Cooper, moving from basic scripts through variables, quoting, loops, functions, arrays, regular expressions, I/O redirection and subshells, with hundreds of annotated example scripts. Readers learn to write and debug nontrivial shell programs.

CourseFree

The Missing Semester of Your CS Education: Shell Tools and Scripting

Covers Bash variables, quoting, control flow, functions, exit codes, globbing and shebangs, then finding files and code with find, fd, grep and ripgrep, and reusing shell history. Includes an hour-long lecture video, full notes and exercises; learners can write and debug small automation scripts.

WebsiteFree

Bash Pitfalls

Sixty-five annotated examples of shell code that looks correct and is not, each with the failure mechanism explained and a safe rewrite. Working through it shows why parsing ls, unquoted expansions and set -e break production scripts. BashGuide builds the model, Pitfalls stress-tests it against the specific failure modes that separate a script that works on your laptop from one that works on a fleet.

BookPaid

Classic Shell Scripting

Robbins and Beebe on writing portable POSIX shell scripts, with substantial coverage of the surrounding toolset: grep, sed, awk, sort, find and xargs. Predates Bash 5 but remains the standard treatment of text-processing pipelines.

WebsiteFree

Google Shell Style Guide

Google's production conventions for Bash: file layout, quoting, variable expansion, function naming, checking return values, avoiding eval, and recognising when a script has outgrown the shell. Answers the question the reference manual deliberately does not: of the many legal ways to write something, which one survives a code review. Includes the 100-line rule — the honest guidance that shell has a ceiling. Short enough to read once and reuse as a review checklist.

WebsiteFree

ShellCheck

Static analysis tool that flags quoting bugs, word-splitting errors, portability problems and misused constructs in shell scripts. Paste a script into the web version or run it locally; every warning links to a wiki page explaining the failure and the fix.

See all Bash & Shell Scripting resources →