$ export
Set an environment variable for child processes
DOCUMENTEDShell builtinsUbuntu 24.04 LTS baseline
Synopsis
export [-fn] [name[=value] ...] or export -p
What it does
- `export` marks shell variables for export to subsequently executed commands.
- The variable remains a shell variable; export controls whether it is placed in the environment of child processes.
Examples
Set and export a variable
export EDITOR=vimExport an existing variable
export PATHImportant details
These examples are intentionally conservative. Command behavior can still depend on filesystem state, permissions, locale, shell, installed package version, and other system configuration.
For exact option semantics, the linked authoritative documentation is the source of truth.