I've recently installed an ubuntu 10.04 server LTS and found out that it looked more attractive to me. Is there a way to get the same coloring mode on CentOS 5/6?

Also, the current user@host on Ubuntu always showing the current path without nasty brackets, I'd like to get that on CentOS too. Would that be possible?

Check out the screenshot

link|improve this question
feedback

migrated from stackoverflow.com Oct 25 '11 at 21:09

This question came from our site for professional and enthusiast programmers.

3 Answers

The appearance of the prompt is dictated by PS1 shell variable. You can check the value of this variable through echo say echo $PS1 on each of your machine & pick the appearance which you prefer and set the value of PS1 as per you need. You can check these links for reference
Hope this helps!

link|improve this answer
feedback

if you type following in your CentOS, does it look ok?

 export PS1="\u@\h \w# "

(#) for root.

if yes, you could put this line in to your .bashrc

link|improve this answer
feedback

continuing from Kent's post,

type this for PS1 variable,

$ export PS1="\e[0;31m[\u@\h \W]\$ \e[m "

  • \e[ Start color scheme

  • x;y Color pair to use (x;y)

  • $PS1 is your sh

  • \u username

  • \h hostname

  • \W current working directory

  • \e[m Stop color scheme


List of Color code

Color Code

Black 0;30

Blue 0;34

Green 0;32

Red 0;31

Purple 0;35

Brown 0;33

Blue 0;34

Green 0;32

Cyan 0;36

Red 0;31

Purple 0;35

Brown 0;33

Replace digit 0 with 1 to get light color version.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown