When I make a change in my ~/.bash_profile file and I add such a variable as:

export PATH="$PATH:$HOME/.composer/vendor/bin"

And after save and close, I need to reflect these changes in my $PATH variable. To do that, I'm doing

source .bash_profile.

When I echo my $PATH variable, the above added path is shown, but when I logout and login again, these changes aren't reflected..

Isn't it so that on each login, the .bash_profile gets reread?


open .bachrc file and write it in it:

type gedit ~/.bashrc in terminal

copy and paste this line at the end of the file(one new line):


this way the path will be available every time you open terminal
besides this, you can also store some variables. for example, add a="this a variable" add the end of file. this variable will be available every time you open terminal. to check type echo $a

| improve this answer | |

You shoud write it in your ~/.bashrc not in your ~/.bach_profile, then it should work

| improve this answer | |

As others have said, you may want to edit ~/.bashrc instead. Just want to mention that if you want the modified PATH to be available also in the graphical environment, you should edit ~/.profile rather than ~/.bashrc.

| improve this answer | |

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