Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Say I want to change the colors of my PS1, or for the sake of simplicity I just want to change the content, so I want to do this:

PS1="touch me : "

My problem, doubt is:

  1. If I put this in .bash_profile, every time I open a terminal I need to source it.
  2. If I put it in .profile, the same, I need to explicitly source it.
  3. It seems nasty to put this in .bashrc directly

Where should I locate this kind of configurations?

share|improve this question
What are you trying to accomplish ? why is it nasty to put your configuration in .bashrc ? .bashrc is probably best, but without knowing what your concerns are hard to give better advice. – bodhi.zazen Feb 15 '13 at 17:47
I have read that bashrc should not be touched for this kind of configurations. Instead it should be put in another place. But I'm pretty ignorant with that. I am trying to put some color on PS1 and show the branch if I am in a directory that has a git repository. – Hommer Smith Feb 15 '13 at 17:49

.bashrc is considered the proper place for such configurations.

For details see:

If you have concerns or someting to the contrary you read somewhere, you would need to express them or post a link for better advice.

share|improve this answer

I usually use .bash_login for that.

From the bash manual:

looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists

While it may be true that .bashrc is the most proper place to make these changes, there's a lot going on in there that I don't want to weed through when I am making edits. I like to keep the original files pristine. So I copy the original (smaller, more manageable) ~/.profile to ~/.bash_login and add my customizations to the end of that file.

One advantage is that if I suspect my customizations are contributing to some kind of problem, I can go back to the vanilla bash configuration by renaming or removing the .bash_login file. Without .bash_login the shell resorts to reading .profile again.

share|improve this answer

Your Answer


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.