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'm trying to add colors and customize the shell prompt on OS X Lion so I edited .bashrc and I can only see the differences for the root account. So, after I edit the .bashrc with:

PS1="[\u][\w] :"

and run the terminal I get

Phil:~ phil$ sudo -s
[root][~] :

but I only see the difference in the root account. How can I fix this?

I want to display:

[Phil][~] : sudo -s
[root][~] :
share|improve this question
You could try ZSH (or a different shell). I know it has all sorts of colors and customizations. If you just want to edit bash, I would recommend changing the question to "add olors and customize bash on OS X Lion). – kalaracey Jun 27 '11 at 15:56
up vote 0 down vote accepted

You need to edit the file .bash_profile in your home directory, i.e. /Users/username/.bash_profile.

share|improve this answer
hey, it works :) thanks. – philberndt Jun 26 '11 at 20:59
Note: ~/.bash_profile is run by login shells. ~/.bashrc is run by non-login shells. To ensure customizations work with both login and non-login shells, put common customizations in ~/.bashrc and have ~/.bash_profile run that with: if [ -f $HOME/.bashrc ]; then . $HOME/.bashrc fi – Chris Page Aug 21 '11 at 8:16
Terminal creates login shells by default. If you run bash from a login shell, that creates a non-login shell. Sub-shells are non-login shells by default. – Chris Page Aug 21 '11 at 8:18

You must log in to answer this question.

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