UNPKG

3.54 kBMarkdownView Raw
1dircolors
2===
3
4置ls命令在显示目录或文件时所用的色彩
5
6## 补充说明
7
8**dircolors命令** 设置ls命令在显示目录或文件时所用的色彩。dircolors可根据[色彩配置文件]来设置LS_COLORS环境变量或是显示设置LS_COLORS环境变量的命令。
9
10### 语法
11
12```shell
13dircolors(选项)(参数)
14```
15
16### 选项
17
18```shell
19-b或--sh或--bourne-shell:显示在Boume shell中,将LS_COLORS设为目前预设置的shell指令;
20-c或--csh或--c-shell:显示在C shell中,将LS_COLORS设为目前预设置的shell指令;
21-p或--print-database:显示预设置;
22-help:显示帮助;
23-version:显示版本信息。
24```
25
26### 参数
27
28文件:指定用来设置颜色的文件。
29
30### 实例
31
32```shell
33[root@localhost ~]# dircolors -p
34# Configuration file for dircolors, a utility to help you set the
35# LS_COLORS environment variable used by GNU ls with the --color option.
36# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
37# slackware version of dircolors) are recognized but ignored.
38# Below, there should be one TERM entry for each termtype that is colorizable
39TERM linux
40TERM linux-c
41TERM mach-color
42TERM console
43TERM con132x25
44TERM con132x30
45TERM con132x43
46TERM con132x60
47TERM con80x25
48TERM con80x28
49TERM con80x30
50TERM con80x43
51TERM con80x50
52TERM con80x60
53TERM cygwin
54TERM dtterm
55TERM putty
56TERM xterm
57TERM xterm-color
58TERM xterm-debian
59TERM rxvt
60TERM screen
61TERM screen-bce
62TERM screen-w
63TERM vt100
64TERM Eterm
65# Below are the color init strings for the basic file types. A color init
66# string consists of one or more of the following numeric codes:
67# Attribute codes:
68# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
69# Text color codes:
70# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
71# Background color codes:
72# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
73NORMAL 00 # global default, although everything should be something.
74FILE 00 # normal file
75DIR 01;34 # directory
76LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
77 # numerical value, the color is as for the file pointed to.)
78FIFO 40;33 # pipe
79SOCK 01;35 # socket
80DOOR 01;35 # door
81BLK 40;33;01 # block device driver
82CHR 40;33;01 # character device driver
83ORPHAN 40;31;01 # symlink to nonexistent file
84SETUID 37;41 # file that is setuid (u+s)
85SETGID 30;43 # file that is setgid (g+s)
86STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
87OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
88STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
89# This is for files with execute permission:
90exec 01;32
91# List any file extensions like '.gz' or '.tar' that you would like ls
92# to colorize below. Put the extension, a space, and the color init string.
93# (and any comments you want to add after a '#')
94# If you use DOS-style suffixes, you may want to uncomment the following:
95#.cmd 01;32 # executables (bright green)
96#.exe 01;32
97#.com 01;32
98#.btm 01;32
99#.bat 01;32
100.tar 01;31 # archives or compressed (bright red)
101.tgz 01;31
102.arj 01;31
103.taz 01;31
104.lzh 01;31
105.zip 01;31
106.z 01;31
107.Z 01;31
108.gz 01;31
109.bz2 01;31
110.deb 01;31
111.rpm 01;31
112.jar 01;31
113# image formats
114.jpg 01;35
115.jpeg 01;35
116.gif 01;35
117.bmp 01;35
118.pbm 01;35
119.pgm 01;35
120.ppm 01;35
121.tga 01;35
122.xbm 01;35
123.xpm 01;35
124.tif 01;35
125.tiff 01;35
126.png 01;35
127.mov 01;35
128.mpg 01;35
129.mpeg 01;35
130.avi 01;35
131.fli 01;35
132.gl 01;35
133.dl 01;35
134.xcf 01;35
135.xwd 01;35
136# audio formats
137.flac 01;35
138.mp3 01;35
139.mpc 01;35
140.ogg 01;35
141.wav 01;35
142```
143
144