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

 

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM