The state every program reads
Environment variables are key/value pairs every running process can read. $HOME, $PATH, $USER, $LANG — all of them shape how programs behave. printenv prints them all; echo $VAR shows one.
Set, export, unset
VAR=value— local to this shell only.export VAR=value— passed to every child process.unset VAR— remove it.VAR=value cmd— set just for one invocation.HTTPS_PROXY=... curl ...is the canonical example.
Why export matters
Without export, the value lives only in the current shell. If you spawn python script.py and the script reads os.environ['VAR'], it sees nothing. Always export for tools to pick it up.
The variables you'll touch
$PATH— executable lookup.$HOME— your home dir.$EDITOR— whatgit commitopens (set tonvim,code -w,cursor -w).$PAGER— whatmanuses (set toless -R).$LANG/$LC_*— locale and character set.$TERM— terminal type.
Where to set them
Interactive use → ~/.zshrc. Login-time only → ~/.zprofile. The full breakdown is the next lesson; for now remember that one of those files is the right place.