whatis environment-variable

Environment Variable

Also known as: env var

A named value such as HOME or PATH that is passed from a process to its children and used to configure program behavior.

What Is an Environment Variable in Linux?

Every process has an environment: a list of NAME=value strings inherited from its parent. Shells distinguish plain shell variables from exported ones; only exported variables reach programs you start.

Set one for a single command with VAR=value command, or for the session with export VAR=value. Persistent variables usually go in ~/.bashrc, ~/.profile, or /etc/environment, and systemd services set theirs with Environment= lines.

Example

export EDITOR=vim
printenv | sort