-o, --output (Output): Specify where the command should write its output — a file, a format, or a directory. -o or --output tells a command where to write its result, or in what form. curl -o page.html saves the response to a file. gcc -o app names the compiled program. kubectl get pods -o yaml changes the output format.
Frequently asked questions about -o, --output (Output)
How is -o, --output (Output) used in practice?
Without it, most tools print to the screen. That is fine for a quick look, but you lose the result once the terminal scrolls. Writing to a file means you can compare two runs, attach the result to a ticket, or feed it into the next step.
What should you keep in mind with -o, --output (Output)?
The format variant is especially useful. -o json gives you something a script can read reliably, while the default table output is meant for people and can change between versions. If you are parsing a command's output in a script, ask for a structured format instead of cutting columns out of text.
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.