Online Linux Terminal Logo
OnlineLinuxTerminal
Editors & ShellCLI Reference

$export

Set and export environment variables to child shell processes.

Syntax DefinitionPOSIX standard
export [NAME[=VALUE]...]
Linux Community2.4k Online

Chat with real Linux users, learn new commands & get free cheat sheet PDFs.

Try `export` Live in Interactive Sandbox

Zero-install client simulation with real-time feedback.

Open in Fullscreen Workspace↗
bash — terminal

Overview & How export Works

`export` marks shell variables to be exported to the environment of subsequently executed child commands and subshells.

Common Flags & Command Options

Flag / OptionDescription
-pDisplay a list of all exported variables in the current shell.

Practical Real-World Examples

Example #1Export an environment variable
export NODE_ENV=production && echo $NODE_ENV

Sets NODE_ENV to production and verifies with echo.

Sample Output:
production

Frequently Asked Questions

How do you make exported variables permanent across reboots?

Add the `export VAR=value` statement to your `~/.bashrc` or `~/.profile` configuration file.