Centos7默认的文件夹颜色是蓝色,在我的mac终端中这个颜色实在是很难看清楚。
一开始先是修改终端的配色,之前在百度的时候对开发机就是这么操作的,然鹅这次没有作用。
然后是修改mac的文件夹配色:
vim ~/.bash_profile
# 增加颜色设置:
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
:wq
保存退出
然后 source ~/.bash_profile
完美!
然鹅,没有任何作用……服务器上面的文件夹ls出来还是蓝色的,法克。
最后发现了一招,直接修改Centos7上面的文件夹配色设置。
# 先拷贝配置文件到用户根目录底下
cp /etc/DIR_COLORS ~/.dir_colors
# 修改配置文件
vim ~/.dir_colors
找到 DIR 01;34
34表示蓝色,可以改成任何你想要的颜色
颜色对应的数字如下:
31 = red
32 = green
33 = orange
34 = blue
35 = purple
36 = cyan
37 = grey
40 = black background
41 = red background
42 = green background
43 = orange background
44 = blue background
45 = purple background
46 = cyan background
47 = grey background
90 = dark grey
91 = light red
92 = light green
93 = yellow
94 = light blue
95 = light purple
96 = turquoise
100 = dark grey background
101 = light red background
102 = light green background
103 = yellow background
104 = light blue background
105 = light purple background
106 = turquoise background
我这边选的是 32
改完后让配置生效:
eval `dircolors ~/.dir_colors`
重新ls,就能看到文件夹的颜色变了: