LinuxCommandLibrary

export

shell builtin to mark variables for child processes

TLDR

Set an environment variable

$ export [VARIABLE]=[value]
copy
Unset an environment variable
$ export -n [VARIABLE]
copy
Export a function to child processes
$ export -f [FUNCTION_NAME]
copy
Append a pathname to PATH
$ export PATH=$PATH:[path/to/append]
copy
Print list of exported variables
$ export -p
copy

SYNOPSIS

export [options] [name[=value]]

DESCRIPTION

export marks shell variables for export to child processes. Exported variables become environment variables visible to all commands run from the shell.
When a variable is exported, it's passed to the environment of any command or script executed from that shell. This is essential for configuration like PATH, EDITOR, and application-specific settings that child processes need to inherit.
Variables set without export remain local to the current shell. The -n option removes the export attribute while keeping the variable defined. Common in shell scripts and initialization files like .bashrc and .profile.

PARAMETERS

-n

Remove export property from variable
-f
Export shell functions
-p
Print all exported variables

CAVEATS

Shell built-in command. Changes only affect current shell and its children. Variables set without export are local to the shell. Use in shell scripts and startup files.

SEE ALSO

env(1), set(1), bash(1)

> TERMINAL_GEAR

Curated for the Linux community

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99