env

Print environment variables or run a command with a modified environment.

low risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

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.

Common flags
FlagMeaning
-i --ignore-environmentStart with empty environment
-u --unsetRemove a variable from environment
-0 --nullUse null separator instead of newlines
Examples
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 →
Pro tip

Use `env -i` in scripts to avoid inheriting unexpected variables from the user's shell — production deployments should always control their own environment.

Related
printenv export set
Open the full explainer →More in Shell & Scripting

Reference text is hand-written and may be incomplete — check man env for your version. Test destructive commands on a non-production system first.