Let's think about it this way for a second
An environment variable is key-value data the shell keeps track of — things like $HOME (your home folder path), $USER (your username), and $PATH (the list of folders to search for programs) store system-wide settings. The moment you type a command like python3, the shell searches through the folders listed in $PATH in order, and as soon as it finds the python3 executable, it runs it — a program in a folder that's not on PATH can't be run by name alone (you'd need to write the full path, or prefix it with ./). export VAR=value creates a new variable and stores it just for that terminal session — it disappears once you close the terminal.
Let's connect this to a real-world scenario
Running echo $HOME or echo $PATH shows you your system's settings directly. If you don't want your environment variables disappearing every time you close the terminal, you need to add an export line to your ~/.bashrc file — since .bashrc loads first every time you open a new terminal, it'll feel like a permanent setting (you'll run into .bashrc again in later chapters). Keeping sensitive data like API keys and database passwords as environment variables instead of hardcoding them into your code is a good security practice.
Let's try it together in the terminal
echo $HOME
echo $PATH
export MY_NAME="Alice"
echo $MY_NAME
export PATH=$PATH:$HOME/scripts # folder အသစ်ကို PATH ထဲ ထပ်ထည့်Running echo $PATH will show a list of folder paths separated by colons (:).5-Minute Try-It
Run export MY_NAME="your name" and check it with echo $MY_NAME. Then close the terminal, reopen it, and check whether the variable still exists.
A Quick Word of Caution
If you overwrite the PATH variable with something like export PATH=/only/one/folder, you might not even be able to run ls or cd anymore — always include the existing $PATH ($PATH:...).