Linux系统改变ls文件和文件夹颜色方法

本人之前就针对蓝色文件夹的颜色  我是这样修改的:    cp /etc/DIR_COLORS   ~/.dir_colors

                          vim   ~/.dir_colors   , 将DIR 01;33   改为  DIR 01;36    效果还好;

            但是最近浏览网页的时候,有人把文件夹颜色改为白色,之后添加了背景色蓝色,,,效果比较华丽,,,,就是不知道长久用好不,,,

            下面粘贴原文:

---------------------------------------------------------------------------------------------------------------------------------

改变ls目录和文件颜色的方法:

首先:
vi /etc/DIR_COLORS

或者,

cp /etc/DIR_COLORS ~/.dir_colors
vi ~/.dir_colors

文件内设定的“DIR 0134”,为ls命令的目录的颜色设置,01表示粗体,34表示字体蓝色。
改成DIR 01374437是字体白色,44是字背景蓝色。

 

注:数字代表的颜色,在下面会有显示
可以找到文件的两行注释:

# Text color codes:

# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white

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



之后执行:

# eval `dircolors /etc/DIR_COLORS`        次处,我修改的是当前用户的颜色,   所以命令为 :  eval  `dircolors  ~/.dir_colors`
注意命令中的`符号为键盘~符号下面的那个,再执行ls命令就有效果。

 

如果使用不习惯,就建议换成    DIR  01;36

 

  

posted @ 2016-09-14 15:59  the_tops  阅读(12770)  评论(0编辑  收藏  举报