Adding a new directory to PATH varibale
If you want to one line it (which I find more convenient):

echo 'export PATH=$PATH:"/path/to/your/dir"' &gt;&gt; ~/.bash_profile &amp;&amp; source ~/.bash_profile


of course you can change this to your preferences (ie. append or prepend to $PATH, .bashrc, .bash_profile, .zshrc, etc.)