Print environment variables or run a command with a modified environment.
low risk
env displays all current environment variables or runs a program with a temporarily modified environment. env -i runs a command in a completely clean environment — critical for reproducible builds and debugging environment contamination.
| Flag | Meaning |
|---|---|
-i --ignore-environment | Start with empty environment |
-u --unset | Remove a variable from environment |
-0 --null | Use null separator instead of newlines |
envPrint all environment variables · explain & risk-check →env | grep -i proxyCheck proxy settings · explain & risk-check →env -i HOME=/tmp bash --norcLaunch bash with clean environment · explain & risk-check →env NODE_ENV=production node app.jsRun node with overridden env var · explain & risk-check →Use `env -i` in scripts to avoid inheriting unexpected variables from the user's shell — production deployments should always control their own environment.
Reference text is hand-written and may be incomplete — check man env for your version. Test destructive commands on a non-production system first.