Environment variables are the shell's notepad: it reads from them to find the paths of installed programs, your username, the home folder, and all the configurations that dev tools store there (API keys, ports, etc.).
Reading a variable
The $ before the name tells the shell to substitute the variable with its value. Without $, it is just literal text.
$HOME: your personal folder (/Users/vicenteor/c/Users/bloki).$USER: your username.$PATH: the list of folders where the shell looks for executables, separated by:.
Setting and exporting a variable
Without export, the variable only exists in the current shell and is not passed to subprocesses. With export, it is inherited by commands you launch from that shell.
Listing all variables
env lists all exported environment variables. printenv <VAR> prints the value of a single variable.
Persisting a variable across sessions
A variable set with export disappears when you close the terminal. To have it defined every time you open a new terminal, add it to your shell configuration file:
source reloads the file without reopening the terminal.
PATH in detail
$PATH contains something like /usr/local/bin:/usr/bin:/bin. When you type node, the shell searches for an executable named node in each of those folders, in order. which tells you which folder the command was found in.
To add a folder to PATH:
.env files per project
In development, projects often use a .env file at their root to store configuration variables (API keys, database URLs, etc.). These files are not sourced automatically by the shell: a library in your code (like dotenv for Node.js or python-dotenv) loads them.
Concepts-ponts
Le meme concept (cles secretes, URLs, flags) gere a quatre niveaux : le concept fullstack, ton shell local, ta plateforme de deploiement, ta base de donnees managee.
