调整终端Terminal的颜色步骤如下:
1. 编辑文件
sudo vim ~/.bash_profile
2. 添加下面代码
export CLICOLOR=1 export LSCOLORS=gxfxaxdxcxegedabagacad
3. 保存文件,重新打开mac终端 Terminal
搞定!效果图如下:
扩展知识:
CLICOLOR: 前景色和背景色的字符串合并值
LSCOLORS: 对于不同变量所采用的颜色方案,具体看如下表格:
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
而文件类型列表如下:
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
10. directory writable to others, with sticky bit
11. directory writable to others, without sticky
根据上面这个代码说明,你可以自由设置配色方案
上面的bash代码:
export CLICOLOR=1 export LSCOLORS=gxfxaxdxcxegedabagacad
意思是:对于directory而言,它的前景色就是: g(cyan),而背景色就是:x(默认的背景色).
End!