--dry-run, -n (Dry Run): Show what the command WOULD do without actually doing it. Critical safety flag for destructive operations. A dry run shows you what a command would change, without changing anything. The tool goes through the same steps, prints the files it would delete or the records it would update, and then stops.
Frequently asked questions about --dry-run, -n (Dry Run)
How is --dry-run, -n (Dry Run) used in practice?
Use it before anything you cannot undo. Before rsync --delete syncs a folder, before git clean removes untracked files, before a migration script touches a production database. Read the output first. If the list is longer than you expected, you have found the problem before it cost you anything.
What should you keep in mind with --dry-run, -n (Dry Run)?
Not every tool calls it the same thing. git clean -n, rsync --dry-run, kubectl apply --dry-run=client and terraform plan all do the same job. A dry run is only as accurate as the tool behind it, so a dry run that passes does not prove the real run will succeed. It does tell you what the tool intends to do.
Use before running or suggesting shell commands with flags, especially destructive or broad ones (-f/--force, -r/-R recursive, -a/--all, -y/--yes, prune, --hard), and when a user asks what a flag means (-v, -q, -n/--dry-run, -h, -o, -p, -t, -u, -w, -x, -c, -i). Explains flags per tool and prefers dry runs and narrow scopes.
Use this skill before running, or recommending, any Docker command that deletes, wipes, resets, or otherwise irreversibly changes state — even if the user just says to "clean up", "clear the cache", "start fresh", "wipe everything", "nuke it", "reset", "force remove", or "tear down" Docker resources. Covers generic Docker CLI destructive operations not owned by a more specific skill — `docker rm`,
Master ShellCheck static analysis configuration and usage for shell script quality. Use when setting up linting infrastructure, fixing code issues, or ensuring script portability.