Home » Linux

shell 中 ls 颜色设定

By: Zhiqiang Ma On: Apr 17, 2009 Views: 8 No Comment Print Email
Tags: , , ,

bash中,ls后的颜色在黑色背景下有些不是很清楚,例如文件夹是蓝色的,在黑色背景下不好认。
设置一下自己的~/.dir_colors可以解决:

复制一份系统的到自己的目录:
cp /etc/DIR_COLORS ~/.dir_colors

修改 .dir_colors

示例

# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# 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;47 # directory

DIR 01;34;47 # directory
表示文件夹字体为粗体白底蓝色。这样看起来好多了。

Read more:

Digg del.icio.us Stumble Techorati Facebook Newsvine Reddit Twitter
Mixx LinkedIn Google Bookmark Yahoo Bookmark MySpace LiveJournal Blogger RSS feed

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.