Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
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. –  grawity May 14 '11 at 14:48
show 4 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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