The meaning of the prompt in the PS1 variable:
\d: Represents the date, in the format weekday month date, for example: Wed Dec 12\h: Full host name. For example: hostname is debian.linux\h: Take the first name of the host only, as in the example above, then the debian,.linux is omitted \ t: Display time in 24-hour format, such as: hh:mm:ss\t: Display time 12 hours format \a : Display time is 24 hours format: hh:mm\u: The current user's account name such as: Root\v:bash version information such as: 3.2\w: The full working directory name. The home directory will be replaced with a ~ such as display/etc/default/\w: Using basename to get the working directory name, so only the last directory is listed as shown in the previous example, only the default\#: the first command issued www.2cto.com \$: prompt character, If it is root, the prompt is: #, the normal user is: $ but the discovery command prompt is a color, here you can set the PS1 variable to make the prompt into color, in the PS1 set the character sequence color format: \[\e[f; Bm\] where "F" is the font color, number 30~37; "B" is the background color, number 40~47. Cancellation settings: \[\e[0m\] www.2cto.com the code for each font color: reset = 0, black = 30, red = 31, green = 32, yellow = 33, blue = 34, magenta =35. Cyan = 36, white =37
\e[1;31m set to red, \e[0m color reset. Just replace 31 with the desired color code to get my settings
Ps1= ' ${debian_chroot:+ ($debian _chroot)}\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[ 00m\]\$ '
environment variable PS1 setup under Linux