Glossary

export

export is a shell builtin that marks a variable so it is included in the environment of subsequently-executed commands. Without export, a variable exists only in the current shell.

FOO=bar                  # shell-local
export FOO               # now inherited by children
export FOO=bar           # assign and export in one step
export -n FOO            # remove the export attribute
export -p                # list all exported variables

Typical uses: setting PATH, EDITOR, language-specific variables like PYTHONPATH or JAVA_HOME, and application-specific configuration. A login file like ~/.profile or ~/.bash_profile is the usual home for export statements that should apply to every interactive session.

Related terms: env, Shell, Environment Variable

Discussed in:

This site is currently in Beta. Contact: Chris Paton

Textbook of AI · Textbook of Usability · Textbook of Digital Health

Auckland Maths and Science Tutoring

AI tools used: Claude (research, coding, text), ChatGPT (diagrams, images), Grammarly (editing).