Set environment variables available to child processes.
low risk
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.
| Flag | Meaning |
|---|---|
-p --print | Print all exported variables |
-n --unexport | Remove variable from export list (don't delete it) |
-f --function | Export shell functions |
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 →Use `export -p > session_vars.sh` to snapshot your current environment — useful before entering a complex debugging session.
Reference text is hand-written and may be incomplete — check man export for your version. Test destructive commands on a non-production system first.