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'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

1 Answer 1

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

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.