I would like to be able to open the software "Julia" by simply typing julia in a terminal at any location (like I can do for, say, firefox). Currently, I have to type

cd ~/julia

According to the documentation I must:

Add a soft link to the julia executable in the julia directory to /usr/local/bin (or any suitable directory already in your path).

I don't fully understand softlinks, but I can't figure out why this doesn't work:

ln -s ~/julia /usr/local/bin

Why won't this allow me to access the contents of the ~/julia file (including the julia executable) directly?

  • 1
    You had created a softlink for Julia directory inside /usr/local/bin,try to create a softlink for Julia executable file inside /usr/local/bin. – Avinash Raj Feb 15 '14 at 8:42
  • 1
    ln -s /home/$USER/julia/julia /usr/local/bin – Avinash Raj Feb 15 '14 at 8:46
  • OK, now I understand - I thought a softlink would include all the contents of the linked directory in my search, but instead it works more like a Microsoft 'shortcut' to create a 'copy' of the file or program in another place, which of course isn't a real copy but instead links back to the original and runs it. Thanks! – Thomas Moore Feb 16 '14 at 12:19

I assume the executable julia is under ~/julia/ folder. Use the following command in terminal to make a softlink in /usr/local/bin,

sudo ln -s /home/<username>/julia/julia /usr/local/bin

Replace <username> with your actual username. Or,

sudo ln -s "$HOME"/julia/julia /usr/local/bin

Note: you need to use sudo to access /usr/local/bin as it is system directory.

Alternate User level Method (if you do not have root access)

You can create a folder $HOME/bin and put it in path, use the following commands in terminal,

mkdir bin
echo "export PATH=\$HOME/bin:\$PATH" >> ~/.bashrc
. ~/.bashrc

Now create a softlink in $HOME/bin as,

ln -s "$HOME"/julia/julia "$HOME"/bin
| improve this answer | |

You can also just right click on the Julia file and navigate to Make Link then copy the newly created link to anywhere on your home directory.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.