Introduction to the Bash Shell#
A short course that teaches shell fluency from zero. It is a leveling primer, not a comprehensive reference: its job is to take you from “I have never opened a terminal” to “I can stand in a shell, run a command, read its output, and find help on my own” — the footing that every computational course quietly assumes.
It exists for a specific reason. Students arrive at the graduate Molecular and Materials Modelling course with wildly uneven shell skills: some are fluent, some have never seen a command line. A computational course cannot really begin until everyone is on the same footing. This primer closes that gap.
Two promises#
No physics required — ever. Real computational-science files (simulation trajectories, run logs) show up as the playground the commands operate on, but you never need to understand the science to do the shell work. Every exercise that borrows a scientific setting says so out loud and tells you exactly what you may ignore.
No installation required. Every lesson comes with a live terminal: a
real, full-screen bash session in your browser, opened from the “Practice here”
box in each notebook, with the course data already sitting in its filesystem. The
page itself is for reading; the terminal is where you type. Prefer your own
machine? A native terminal works just as well — any Linux terminal, or Windows
via WSL. On macOS a couple of lessons reach for GNU tools it does not ship
(tree, GNU date), so the browser terminal is the smoother path there.
How the course is built#
Every code cell you see is real bash, actually executed — the output below each command is what the command really printed, not a transcript someone typed up. Worked solutions are hidden on this public site (you see each problem and its result, not the answer code); if you would like the reference solutions, the note at the foot of each notebook tells you how to get them.
The roadmap#
The course is a single cumulative ladder of notebooks, grouped into five parts:
Orientation — the terminal, the filesystem, and looking at files.
Pipelines and text extraction — redirection, pipes, globbing,
grep, the stream toolkit,awkandsed. The heart of the course.From commands to scripts — editing in the terminal, quoting, permissions, writing scripts, control flow.
Working on a cluster — environment and modules, remote work, SLURM, and reading realistic scaling data.
Automation —
makeand Makefiles, wiring it all together.
Start at the top of Part I and work down. Each notebook assumes only the ones before it.
To cite the course, use its DOI,
10.5281/zenodo.21418788 (all versions;
full metadata in the repository’s CITATION.cff).
A note on how this course was written#
This course was written in collaboration with a generative AI assistant
(Anthropic’s Claude), and it says so plainly — a course that teaches you to check
what a command actually did should be just as open about its own workings. The
design is the author’s: the judgement of what a working computational scientist
actually needs, the scope and its limits, the sequence from a first prompt to
SLURM and make, and the specification each lesson was built from. The assistant
drafted the lessons to those specifications; the author reviewed, corrected, and
approved every page, and the final word on each is a human’s. And the course
practises what it teaches: every code cell is genuinely executed when the site is
built, and every exercise ends with a check that fails the build if a result is
not what the lesson claims — so nothing here rests on anyone’s word, human or
machine.