5

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.

1 Answer 1

4

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

9
  • 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, 2011 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, 2011 at 4:37
  • Thanks, I eventually edited /root/.bash_profile and it now works.
    – David
    May 14, 2011 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, 2011 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. May 14, 2011 at 14:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .