How to set the command prompt's color in Bash?
@Rob is right; specifically, to change to light red (pink is not an available color):
PS1 = "\[\033[1;31m\]\u:\w\$\[\033[0m\] "
# ^^^^^^^ ^^ Begin/end ANSI escape
# ^^^^^ "light red foreground"
# ^^^^^^^ Your original prompt
# ^^^^^^^^^^^ Reset color back to default foreground
You need to use ANSI escape sequences (in this case 1;31m
, the code for "light red foreground") which are enclosed by \[\033[
and \]
.
Edit: Light purple may be closer to your desired color; the PS1
change is left as an exercise for the reader.
reference @ the linux documentation project