Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 4 down vote accepted

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

share|improve this answer
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
@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
@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. – grawity May 14 '11 at 14:48

You must log in to answer this question.

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