PDA

View Full Version : The colour of user@hostname~@: ?



e2k
06-24-2004, 11:19 PM
Hello again..
This time I'm wondering about the colour of the "user@hostname~@:" in the Console? When I ran knoppix from the cd, it used to be cyan(?), after the hdd-install it's just plain white..
My friends adviced me to edit /home/user/.bash_profile, but I noticed that I didn't even have one! Well my friend sent his one over and I managed to get it into my home folder.. But the colour of user@hostname~@: is still white? How can I change this? What file should I edit/make?

And by the way, I had to shutdown X (init 3) while I was installing the nvidia drivers.. There I noticed a change of colours.. Did the .bash_profile I created only affect that?

eco2geek
06-25-2004, 01:24 AM
You should take a look at the Bash Prompt HOW-TO (http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/index.html) at the Linux Documentation Project (http://www.tldp.org) -- specifically the section on Colors (http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html).

For example, in order to change the color of the bash prompt to cyan for all users, look for the following line in /etc/profile (as root):

PS1="\u@\h:\w\\$ "

Change it to this (additions bolded):

PS1="\[\033[1;36m\]\u@\h:\w\\$\[\033[0m\] "

(Dunno about the NVidia part of your question. Nothing radically changed when I installed 'em...)

If you only want the changes to apply to your user, instead of all users, add the line to ~/.bashrc instead of /etc/profile.

e2k
06-25-2004, 09:32 AM
Thank you, that was exactly what I was looking for :)