I am trying to save the PATH environment variable from the Terminal running on a Ubuntu system.

I typed in the following however it does not get saved.

export PATH=/home/david/Komodo-Edit-6/bin/:$PATH

Any suggestions on how I can fix this? Thank you.


Add that line to ~/.bashrc, or the appropriate configuration file for your shell.

  • To you mean this export PATH=/home/david/Komodo-Edit-6/bin/:$PATH ~/.bashrc, because it doesn't work. I am using the bash shell. – David May 14 '11 at 4:24
  • 1
    @David No. I mean to edit the file ~/.bashrc and add the export statement to its contents. – Daniel Beck May 14 '11 at 4:37
  • Thanks, I eventually edited /root/.bash_profile and it now works. – David May 14 '11 at 4:53
  • @David .bash_profile is, by default, only loaded for login shells. It likely won't work if you start bash yourself. – Daniel Beck May 14 '11 at 5:08
  • 3
    @Daniel: In the specific case of appending/prepending to $PATH environment variable, the profile file is even better, because 1) the new value is exported to other processes anyway, and 2) if it was in bashrc, then you could end up with the same directory 3 or 4 times. – user1686 May 14 '11 at 14:48

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.