BASH Shell Change The Color of Shell Prompt on Linux or UNIX


#1

Originally published at: https://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/

How do I change the color of my shell prompt under Linux or Unix operating systems?


#2
    ## Black       0;30     Dark Gray     1;30
    ## Blue        0;34     Light Blue    1;34
    ## Green       0;32     Light Green   1;32
    ## Cyan        0;36     Light Cyan    1;36
    ## Red         0;31     Light Red     1;31
    ## Purple      0;35     Light Purple  1;35
    ## Brown       0;33     Yellow        1;33
    ## Light Gray  0;37     White         1;37

My prompt:

PS1="[\[\e[1;34m\]$WINDOW\[\e[0m\]:\[\e[1;$UCOL\]\$(sens)\[\e[0m\]$SEP\u@\[\e[1;$ENV\]\h.$ENAME\[\e[0m\]:\[\e[1;31m\]\$(get_branch)\[\e[0m\] \w]\\$ ";

^ thats mine with some data pumped in via functions, but basically surround text with:

\[\e[1;34m\] XXX \[\e[0m\] <- light blue XXX

the start and end parts begin colour and end colour