The CentOS version of the Linux command prompt is the default color, sometimes tired of watching, so give it a bit of color to see.
Command prompt symbol is made to PS1, it's help description can be man bash under Search PS1 can view, some function parameters, I do not introduce, at the command line input:
[email protected] etc] #PS1 = "\[\033[1;32m\][\[\033[1;31m\]\u\[\033[1;36m\]@\[\033[1;35m\]\h \[\033[1;33m\]\w\[\ 033[1;32m\]]\[\033[1;31m\]\\$\[\033[0m\] "
[root@web etc] #
The format of the character sequence color in PS1 is:\[\033[function; color code m\] character \[\033[0m\]
Color coding: Where number 30~37 is font color, number 40~47 is background color
Foreground background color function meaning
30 40 Black 0 OFF
31 41 Red 1 highlight
32 42 Green
33 43 Yellow
34 44 Blue
35 45 Purplish red
36 46 Cyan Blue
37 47 White
This uses the font color, if you want to set the background color can use \[\033[function; font color; background color m\] character \[\033[0m\]
You want to set the character after the \[\033[0m\], that is, cancel the setting, or it will affect the following characters, unless you want to continue to set the color of the next character can not be canceled, put the cancellation at the end, will not affect the color of the command.
Get your Linux command prompt to dazzle [email protected] etc]#