Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

migrated from Oct 25 '11 at 21:09

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

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!

share|improve this answer

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

share|improve this answer

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.

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.