Make binaries executable from anywhere

Generally I like to maintain binaries. It could be downloaded or custom etc.

Here is what I do

  • Actions
mkdir ~/my_bin
echo "export PATH=\$PATH:~/my_bin" >> ~/.bashrc
source ~/.bashrc

Note: It last till the terminal session when you execute "export PATH=$PATH:</path/to/file>" at the command line.

To tell terminal to remember it everytime you start, add the same lines in the file ~/.bashrc or ~/.zshrc