我不知道正常人看Linux下面文件夾的顏色(默認為深藍)是不是有點暈暈的,看不清楚,反正對我這樣的色弱的人來說,我看着很不爽,所以我到網上去找了一下,如果修改文件夾顏色的方法,網上真實眾說紛紜,很多都不好使,我綜合了很多的說法,合並了一個可行的。
總體上而言,這個問題分為三步來解決:
1,搞一個配置文件到你個人用戶的根目錄下
2,修改這個文件
3,重新load一下
第一步,配置文件:
A,dircolors -p > ~/.dircolors (這個名字一會會用到)
B,cp /etc/DIR_COLORS ~/.dircolors
我用的是第一種,第二種我沒有扎到這個文件。
第二步,修改文件:
打開文件,找到這一行:DIR 01;34 # directory
# Background color codes: # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white NORMAL 00 # global default, although everything should be something. FILE 00 # normal file DIR 01;34 # directory LINK 01;36 # symbolic link FIFO 40;33 # pipe SOCK 01;35 # socket BLK 40;33;01 # block device driver
修改34,換一個你想要的顏色就可以了, # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
我修改成了33,一定要騷一點,哈哈!
第三步,重新加載:
這個時候還需要看一下~/.bashrc這個文件,里面有關於我上面說名字會用到的那個關聯,
75 # enable color support of ls and also add handy aliases 76 if [ -x /usr/bin/dircolors ]; then 77 test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" 78 alias ls='ls --color=auto' 79 #alias dir='dir --color=auto' 80 #alias vdir='vdir --color=auto' 81 82 alias grep='grep --color=auto' 83 alias fgrep='fgrep --color=auto' 84 alias egrep='egrep --color=auto' 85 fi
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
這句話里面上面這個文件名字,他們指的是一個文件,所以,名字怎么起,你懂的!
OK,給名字搞定之后,只需要 source ~/.bashrc 執行以下就重新加載了(當然,你也可以退出,在連接)
效果圖:

好吧,圖片上效果不是很明顯,你自己可以去試試了!
記在這里,以后我會忘了的。。。
