Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have added some new commands to ~/.bash_profile but every time I start a new terminal session, it seems to forget these commands and I have to do . ~/.bash_profile again. Is there a way to avoid this doing every single terminal session?

Thanks.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

I don't know why ~/.bash_profile is getting overwritten, but I've had problems with it before too. Instead, use ~/.bashrc.

What I do is create the file ~/.bashrc2. In that file I put all my custom commands. After you have what you want, edit ~/.bashrc and add this line at the bottom:

. ~/.bashrc2

Even if ~/.bashrc gets modified, it won't hurt your customizations. Now you have a portable customization file that you can take to any computer.

share|improve this answer

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.