Color configuration involves the following places (I often use): command prompt, file and directory name display, ECHO-E command
1. Color values are divided into foreground and background colors, and the corresponding relationship of color code values is as follows:
Front back Color - +Black to ARed + theGreen - +Yellow (brown) the -Blue * $Violet $ $QingPanax Notoginseng -White
2. Color formatting
(1) The echo command uses
"\033[F; Bmstring\033[0m "F and B represent the code values for foreground and background colors, respectively
Echo-e "\033[32;40m[ok]\033[0m" #显示黑底绿字的 "[OK]"
(2) Command prompt color
Modify the ~/.BASHRC file to add the following:
Export ps1= ' [\[\e[32;40m\]\[email protected]\w]\$ '
(3) Modify the shell Terminal display directory, the color of the file name
In the system command line interface The default directory color is blue, in the black background can not see, modify the Color method:
Cp/etc/dir_colors ~/.dir_colors
Vim ~/.dir_colors
Find "dir 01;34" modified to "dir 01;32"
Shell Color configuration under Linux