# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
设置定义
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
d = (BLOCK, BLK) Block device (buffered) special file
cd = (CHAR, CHR) Character device (unbuffered) special file
di = (DIR) Directory
do = (DOOR) [Door][1]
ex = (EXEC) Executable file (ie. has 'x' set in permissions)
fi = (FILE) Normal file
ln = (SYMLINK, LINK, LNK) Symbolic link. If you set this to ‘target’ instead of a numerical value, the color is as for the file pointed to.
mi = (MISSING) Non-existent file pointed to by a symbolic link (visible when you type ls -l)
no = (NORMAL, NORM) Normal (non-filename) text. Global default, although everything should be something
or = (ORPHAN) Symbolic link pointing to an orphaned non-existent file
ow = (OTHER_WRITABLE) Directory that is other-writable (o+w) and not sticky
pi = (FIFO, PIPE) Named pipe (fifo file)
sg = (SETGID) File that is setgid (g+s)
so = (SOCK) Socket file
st = (STICKY) Directory with the sticky bit set (+t) and not other-writable
su = (SETUID) File that is setuid (u+s)
tw = (STICKY_OTHER_WRITABLE) Directory that is sticky and other-writable (+t,o+w)
*.extension = Every file using this extension e.g. *.rpm = files with the ending .rpm
颜色定义
ISO 6429 color sequences are composed of sequences of numbers separated by semicolons. The most common codes are:
0 to restore default color
1 for brighter colors
4 for underlined text
5 for flashing text
30 for black foreground
31 for red foreground
32 for green foreground
33 for yellow (or brown) foreground
34 for blue foreground
35 for purple foreground
36 for cyan foreground
37 for white (or gray) foreground
40 for black background
41 for red background
42 for green background
43 for yellow (or brown) background
44 for blue background
45 for purple background
46 for cyan background
47 for white (or gray) background