First, color highlighting
Use bash mode for terminal:
- To edit ~/.bash_profile, add the following code:
Export Clicolor=1export Lscolors=gxfxaxdxcxegedabagacad
- Save, then restart Terminal, fix it, get back to normal.
Explain the meaning of the code in detail:
- Clicolor: String merge values for foreground and background colors
- Lscolors: For the color scheme used in different variables, see the following table:
A black
b Red
C Green
D Brown
E Blue
F Magenta
G Cyan
H Light Grey
A Bold Black, usually shows up as dark grey
B Bold Red
C Bold Green
D Bold Brown, usually shows up as yellow
E Bold Blue
F Bold Magenta
G Bold Cyan
H bold light grey; Looks like bright white
x default foreground or background
A list of file types is as follows:
1. Directory
2. Symbolic link
3. Socket
4. Pipe
5. Executable
6. Block Special
7. Character Special
8. Executable with setuid bit set
9. Executable with Setgid bit set
Directory writable to others, with sticky bit
Directory writable to others, without sticky
So, against this watch, you can tell:
Gxfxaxdxcxegedabagacad
For directory, the foreground color is g (cyan), and the background color is: X (the default background color).
MacBook set terminal command line color highlighting