vim ~/.bash_profile
添加如下两行
export CLICOLOR = 1
export LSCOLOR = Gxfxaxdxcxegedabagacad
配置说明:
CLICOLOR
(Command Line Interface Color)是用来设置是否进行颜色的显示,CLI是的缩写。
LSCOLORS
是用来设置当CLICOLOR
被启用后,各种文件类型的颜色。 LSCOLORS的值中每两个字母为一组,分别设置某个文件类型的文字颜色和背景颜色。 LSCOLORS中一共11组颜色设置,按照先后顺序,分别对以下的文件类型进行设置:
- directory
- symbolic link
- socket
- pipe
- executable
- block special
- character special
- executable with setuid bit set
- executable with setgid bit set
- directory writable to others, with sticky bit
- directory writable to others, without sticky bit
颜色对照表:
a 黑色
b 红色
c 绿色
d 棕色
e 蓝色
f 洋红色
g 青色
h 浅灰色
A 黑色粗体
B 红色粗体
C 绿色粗体
D 棕色粗体
E 蓝色粗体
F 洋红色粗体
G 青色粗体
H 浅灰色粗体
x 系统默认颜色
另外 iTerim2
的可以通过个人配置设置颜色。