Definition
What it is
A dry run is a rehearsal with the tooling of the real thing. It runs the same code path, reads the same inputs, computes the same plan, and prints it. What it does not do is commit. rsync --dry-run lists the files it would transfer. git commit --dry-run reports the commit it would create. terraform plan computes the diff it would apply. make -n prints the commands it would run.
The value is diagnostic. A dry run answers the question "what would change?" before the change becomes irreversible. In production, that answer is often worth more than the change itself.
Dry run vs --force vs preview
Aspect | Dry run | --force | Preview |
|---|---|---|---|
Side effects | None | All | Depends |
Reversibility | Instant | Depends on backup | Instant |
Typical flag |
|
| URL param, mode toggle |
Best for | Validating changes | Overriding guards | Showing rendered output |
Fails safe? | Always | Rarely | Depends |
Where dry runs happen
graph LR
A["User requests change"] --> B["Tool computes plan"]
B --> C{"--dry-run?"}
C -->|Yes| D["Print plan, exit"]
C -->|No| E["Commit side effects"]
D --> F["User reviews"]
F --> A
E --> G["Change visible"]
style D fill:#FFF3E0
style G fill:#E8F5E9
Common dry-run flags
rsync --dry-run/-n— lists files that would be transferred.git commit --dry-run— shows what would be committed.make -n— prints commands without executing them.terraform plan— computes the diff before apply.ansible-playbook --check— runs playbook without making changes.docker compose --dry-run(experimental) — prints the config that would be applied.mkdir --dry-run— GNU coreutils 8.x added the flag for consistency.
How to use one well
A dry run that actually catches mistakes
Read the plan, do not skim
A plan with three changes is easy to review. A plan with three thousand changes needs a second opinion.
Compare against expectations
If you expected one file deleted and the plan says fifteen, stop.
Dry-run against production
Staging has different data. A dry run against the real target catches the surprises that staging hides.
Log the dry run
Save the plan output. It becomes the contract for what the real run should produce.
Origin
In theatre, a dry run (or dry tech) is a rehearsal without costumes, without full makeup, without the full set. The actors run their lines and their blocking, but the expensive parts of the production are not yet in play. The purpose is to check timing and staging before the dress rehearsal, where the real thing happens with all the consequences.
In chemistry, a dry run is an experiment run without the solvent that will be used in the real reaction, to test a procedure's steps. The metaphor crossed to engineering, where a dry run means a test execution with the expensive or irreversible parts disabled.
Software adopted it in the 1970s with make -n, formalized it in the 1980s and 1990s with rsync --dry-run and similar flags, and made it central to modern infrastructure-as-code: terraform plan is a dry run made into a product feature.
A dry run is a rehearsal of a process that shows what the process would do if you let it happen, without letting it happen.
— Adapted from rsync documentation, 1996
Evidence
FAQ
- When should I dry-run?
Before any change that is expensive to undo: mass edits, migrations, deploys, infrastructure changes, DNS updates.
- Why does the plan disagree with the real run?
State drift: the tool's view of the world is stale. Refresh state, then dry-run again.
- What if the tool has no dry-run flag?
Emulate it: read the docs, back up first, or run against staging. A missing flag is not an excuse.
- Is dry-run the same as --check?
Semantically yes; different tools use different names. Ansible uses
--check, rsync uses--dry-run, terraform usesplan.
Connections
GNU Make manual (2024). Instead of Executing Recipes. https://www.gnu.org/software/make/manual/make.html
rsync manual (2024). --dry-run / -n. https://download.samba.org/pub/rsync/rsync.1
HashiCorp (2024). Terraform plan. https://developer.hashicorp.com/terraform/cli/commands/plan
Etymology
Origin: metaphor
dry(adjective): without liquid; figuratively, without the full conditionsrun(noun): a continuous sequence of operation
Semantic network
● broader ● narrower ● related
Sources
GNU Make manual (2024). Instead of Executing Recipes. https://www.gnu.org/software/make/manual/make.html
rsync manual (2024). --dry-run / -n. https://download.samba.org/pub/rsync/rsync.1
HashiCorp (2024). Terraform plan. https://developer.hashicorp.com/terraform/cli/commands/plan