export

Set environment variables available to child processes.

low risk

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

export marks a shell variable for export to the environment of child processes. Without export, variables are local to the current shell only. Used extensively in CI/CD pipelines, Docker, and application configuration. export -p lists all exported variables.

Common flags
FlagMeaning
-p --printPrint all exported variables
-n --unexportRemove variable from export list (don't delete it)
-f --functionExport shell functions
Examples
export AWS_REGION=ap-south-1Set AWS region for CLI commands · explain & risk-check →
export PATH="$HOME/.local/bin:$PATH"Prepend local bin to PATH · explain & risk-check →
export -p | grep AWSList all exported AWS-related variables · explain & risk-check →
export KUBECONFIG=~/.kube/config:~/.kube/prodMerge multiple kubeconfig files · explain & risk-check →
Pro tip

Use `export -p > session_vars.sh` to snapshot your current environment — useful before entering a complex debugging session.

Related
env printenv source
Open the full explainer →More in Shell & Scripting

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