Set environment variables for the shell and its child processes quickly and reliably. 11.03.2026 | reading time: 2 min The export command marks shell variables so child processes inherit them; this is essential for scripts, services and tools that rely on environment settings. A quick hands-on example Try this now: run `export EDITOR=vim` and then `echo $EDITOR` will show vim; launch a subshell with `bash -c 'echo $EDITOR'` to confirm the value is inherited by child processes. Assignment vs. export in practice Assigning a variable without export keeps it local to the current shell; for example `FOO=bar; bash -c 'echo $FOO'` prints nothing, while `FOO=bar; export FOO; bash -c 'echo $FOO'` prints bar. Advanced tips and caveats Use `export -p` to list exported variables and `export -n NAME` to un-export a variable; bash can export functions with `export -f funcname` but that is nonstandard and may not survive to other shells or remote sessions. Complementary commands to use Use `env VAR=value command` to run a single command with a modified environment, `printenv` or `env` to inspect variables, and `source` to load variables from a file such as a profile or a script. Where to go next Mastering export pays off in automation and services; keep practicing with real scripts and consider formalizing skills with certifications such as CompTIA Linux+ or LPIC-1, with bitsandbytes.academy as an intensive exam preparation. Join Bits & Bytes Academy First class LINUX exam preparation. scripting utilities processes setup