Shell

export

Set environment variables so they are available to child processes.

Synopsis

syntax
export [OPTION]... [NAME[=VALUE]]...

Examples

Add to PATH
export PATH=$PATH:/usr/local/go/bin
Set environment variable
export NODE_ENV=production
List all exported variables
export -p
Unexport a variable
export -n MY_VAR

Common options

FlagDescription
-nRemove export property from variable
-pDisplay all exported variables
-fExport shell functions

About export

The `export` command set environment variables so they are available to child processes. Shell commands configure your interactive environment — variables, aliases, history, and shell options.

The shell is your primary interface with Linux, and customizing it improves productivity. These commands work across bash, zsh, and other POSIX-compatible shells with minor differences.

The command accepts 3 commonly used flags shown above, though the full set of options is available in the man page (`man export`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Shell Commands

Other commands in the Shell category

Related tools