Definition
Environment variables are named string values that a process inherits from its parent at the moment it is created. They form an out-of-band configuration channel — separate from command-line arguments, from configuration files, and from any input on standard input — that almost every Unix program reads at startup. Setting an environment variable in a shell session, or in a CI runner, or in a container manifest, is the standard way to tell a program "here is some configuration that I do not want to bake into your code or pass on every invocation."
A small set of variables is universal. PATH lists the directories the shell searches to resolve a command name. HOME points to the current user's home directory. USER names the current user. LANG and LC_* select language and locale. Beyond these conventions, every program is free to define its own — DATABASE_URL, NODE_ENV, AWS_REGION — and modern twelve-factor deployment practice leans on this channel heavily.
Why it matters
How it works
The kernel hands each new process a copy of its parent's environment block — a list of NAME=value strings — at the moment of execve. After that point the parent and child have independent copies; a child cannot change a parent's environment, only its own. This is why exporting a variable in a subshell never leaks back into the surrounding shell, and why every fresh shell starts from whatever the login process configured.
Programs read the environment via library calls (getenv in C, os.environ in Python, process.env in Node, $ENV in the shell). Shells provide syntax for setting variables (NAME=value), exporting them so children inherit them (export NAME), and inspecting them (env, printenv). The most consequential variable is PATH: when you type a bare command name, the shell walks PATH directory by directory, executing the first matching file it finds. Misordering PATH is how a malicious or out-of-date binary can hijack a command you thought you knew — a recurring source of subtle bugs and a recurring target for security audits.