1

I am trying to install leiningen to an Ubuntu virtual machine. But I am having a very difficult time because of my lack of Ubuntu/linux knowledge. I am specifically stuck on step two of the leiningen install steps: Place it on your $PATH where your shell can find it (eg. ~/bin)

So I have had success downloading the script and editing its executable settings. But I am not sure how to move it to ~/bin. It usually just ends up "disappearing".

How might I move the script to that directory?

  • The script more than likely now sits in a file named ~/bin. Where is it in the first place? – Ken Sharp Apr 17 '15 at 1:44
2

The directory ~/bin

~/bin is simply a folder named "bin" in your personal home directory.
"~" stands for your home directory, so ~/bin is actually: /home/<yourname>/bin.

You probably still have to create the folder. You can do that just like you make any other folder, and move the executable into that folder (make sure the file is executable).

$PATH

~/bin is included in $PATH by default, which means that you can run executables inside the folder by a command that is simply equal to the name of the executable; you don't need to include the path to the script to run it.

Note

After you created ~/bin and added the script, you will probably have to log out and back in for it to work (or alternativeley, run source ~/.profile, as suggested by @muru, @Thomas W.)

  • Alternatively, source ~/.bashrc might refresh the environment vars and give access to ~/bin. If the applicatino is a GUI applictaion though then a logout/login will be needed – Thomas Ward Jan 15 '15 at 19:39
  • IIRC it is .profile which adds ~/bin to the PATH, not .bashrc. – muru Jan 15 '15 at 19:48
  • @muru Thanks, I will remove it until I am sure. – Jacob Vlijm Jan 15 '15 at 19:52
  • 2
    @muru, you were correct, source ~/.profile did the job on my "clean" laptop. – Jacob Vlijm Jan 15 '15 at 20:11
  • @muru ahhh, you're right, it is ~/.profile - although my .profile and .bashrc have that definition for ~/bin in PATH reversed - i think it was before the ~/bin change added to ~/.profile. My bad! – Thomas Ward Jan 15 '15 at 21:06

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.