Let’s say you just installed mysql on your Mac. You want to be able to fire up the daemon from the CLI.
This appends the mysql path to the other things in your path and stores it in .bash_profile so you never have to do this again for this daemon.
echo 'export PATH=$PATH:/usr/local/mysql/bin' >> ~/.bash_profile
This reloads your profile to activate your path change in the current terminal.
Bonus: change the prompt on your terminal to include your current working directory.
echo "PS1='\w\$ '" >> ~/.bash_profile; source ~/.bash_profile