Adding a new directory to PATH varibale What is the de-facto way to export a binary/executable to my global PATH? I have seen different answers to this, but I am looking for the best answer. 

Basically, if I go on Github and download a directory or folder and then I want to add whatever I download to my PATH, what is the recommended way to do that, so that I can echo it in any shell?
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.)