OSDN Git Service

(split) LDP: Update original to LDP v3.52.
[linuxjm/LDP_man-pages.git] / original / man5 / dir_colors.5
1 .\" manpage for /etc/dir_colors, config file for dircolors(1)
2 .\" extracted from color-ls 3.12.0.3 dircolors(1) manpage
3 .\"
4 .\" %%%LICENSE_START(LDPv1)
5 .\" This file may be copied under the conditions described
6 .\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998
7 .\" that should have been distributed together with this file.
8 .\" %%%LICENSE_END
9 .\"
10 .\" Modified Sat Dec 22 22:25:33 2001 by Martin Schulze <joey@infodrom.org>
11 .\"
12 .TH DIR_COLORS 5 2001-12-26 "GNU" "Linux User Manual"
13 .SH NAME
14 dir_colors \- configuration file for dircolors(1)
15 .SH DESCRIPTION
16 The program
17 .BR ls (1)
18 uses the environment variable
19 .B LS_COLORS
20 to determine the colors in which the filenames are to be displayed.
21 This environment variable is usually set by a command like
22
23 .RS
24 eval \`dircolors some_path/dir_colors\`
25 .RE
26
27 found in a system default shell initialization file, like
28 .I /etc/profile
29 or
30 .IR /etc/csh.cshrc .
31 (See also
32 .BR dircolors (1).)
33 Usually, the file used here is
34 .I /etc/DIR_COLORS
35 and can be overridden by a
36 .I .dir_colors
37 file in one's home directory.
38 .PP
39 This configuration file consists of several statements, one per line.
40 Anything right of a hash mark (#) is treated as a comment, if the
41 hash mark is at the beginning of a line or is preceded by at least one
42 whitespace.
43 Blank lines are ignored.
44 .PP
45 The
46 .I global
47 section of the file consists of any statement before the first
48 .B TERM
49 statement.
50 Any statement in the global section of the file is
51 considered valid for all terminal types.
52 Following the global section
53 is one or more
54 .I terminal-specific
55 sections, preceded by one or more
56 .B TERM
57 statements which specify the terminal types (as given by the
58 .B TERM
59 environment variable) the following declarations apply to.
60 It is always possible to override a global declaration by a subsequent
61 terminal-specific one.
62 .PP
63 The following statements are recognized; case is insignificant:
64 .TP
65 .B TERM \fIterminal-type\fR
66 Starts a terminal-specific section and specifies which terminal it
67 applies to.
68 Multiple
69 .B TERM
70 statements can be used to create a section which applies for several
71 terminal types.
72 .TP
73 .B COLOR yes|all|no|none|tty
74 (Slackware only; ignored by GNU
75 .BR dircolors (1).)
76 Specifies that colorization should always be enabled (\fIyes\fR or
77 \fIall\fR), never enabled (\fIno\fR or \fInone\fR), or enabled only if
78 the output is a terminal (\fItty\fR).
79 The default is \fIno\fR.
80 .TP
81 .B EIGHTBIT yes|no
82 (Slackware only; ignored by GNU
83 .BR dircolors (1).)
84 Specifies that eight-bit ISO 8859 characters should be enabled by
85 default.
86 For compatibility reasons, this can also be specified as 1 for
87 \fIyes\fR or 0 for \fIno\fR.
88 The default is \fIno\fR.
89 .TP
90 .B OPTIONS \fIoptions\fR
91 (Slackware only; ignored by GNU
92 .BR dircolors (1).)
93 Adds command-line options to the default
94 .B ls
95 command line.
96 The options can be any valid
97 .B ls
98 command-line options, and should include the leading minus sign.
99 Note that
100 .B dircolors
101 does not verify the validity of these options.
102 .TP
103 .B NORMAL \fIcolor-sequence\fR
104 Specifies the color used for normal (nonfilename) text.
105 .TP
106 .B FILE \fIcolor-sequence\fR
107 Specifies the color used for a regular file.
108 .TP
109 .B DIR \fIcolor-sequence\fR
110 Specifies the color used for directories.
111 .TP
112 .B LINK \fIcolor-sequence\fR
113 Specifies the color used for a symbolic link.
114 .TP
115 .B ORPHAN \fIcolor-sequence\fR
116 Specifies the color used for an orphaned symbolic link (one which
117 points to a nonexistent file).
118 If this is unspecified,
119 .B ls
120 will use the
121 .B LINK
122 color instead.
123 .TP
124 .B MISSING \fIcolor-sequence\fR
125 Specifies the color used for a missing file (a nonexistent file which
126 nevertheless has a symbolic link pointing to it).
127 If this is unspecified,
128 .B ls
129 will use the
130 .B FILE
131 color instead.
132 .TP
133 .B FIFO \fIcolor-sequence\fR
134 Specifies the color used for a FIFO (named pipe).
135 .TP
136 .B SOCK \fIcolor-sequence\fR
137 Specifies the color used for a socket.
138 .TP
139 .B DOOR \fIcolor-sequence\fR
140 (Supported since fileutils 4.1)
141 Specifies the color used for a door (Solaris 2.5 and later).
142 .TP
143 .B BLK \fIcolor-sequence\fR
144 Specifies the color used for a block device special file.
145 .TP
146 .B CHR \fIcolor-sequence\fR
147 Specifies the color used for a character device special file.
148 .TP
149 .B EXEC \fIcolor-sequence\fR
150 Specifies the color used for a file with the executable attribute set.
151 .TP
152 .B LEFTCODE \fIcolor-sequence\fR
153 Specifies the
154 .I "left code"
155 for non-ISO\ 6429 terminals (see below).
156 .TP
157 .B RIGHTCODE \fIcolor-sequence\fR
158 Specifies the
159 .I "right code"
160 for non-ISO\ 6429 terminals (see below).
161 .TP
162 .B ENDCODE \fIcolor-sequence\fR
163 Specifies the
164 .I "end code"
165 for non-ISO\ 6429 terminals (see below).
166 .TP
167 \fB*\fIextension\fR \fIcolor-sequence\fR
168 Specifies the color used for any file that ends in \fIextension\fR.
169 .TP
170 \fB .\fIextension\fR \fIcolor-sequence\fR
171 Same as \fB*\fR.\fIextension\fR.
172 Specifies the color used for any file that
173 ends in .\fIextension\fR.
174 Note that the period is included in the
175 extension, which makes it impossible to specify an extension not
176 starting with a period, such as
177 .B ~
178 for
179 .B emacs
180 backup files.
181 This form should be considered obsolete.
182 .SS ISO 6429 (ANSI) color sequences
183 Most color-capable ASCII terminals today use ISO 6429 (ANSI) color sequences,
184 and many common terminals without color capability, including
185 .B xterm
186 and the widely used and cloned DEC VT100, will recognize ISO 6429 color
187 codes and harmlessly eliminate them from the output or emulate them.
188 .B ls
189 uses ISO 6429 codes by default, assuming colorization is enabled.
190
191 ISO 6429 color sequences are composed of sequences of numbers
192 separated by semicolons.
193 The most common codes are:
194 .sp
195 .RS
196 .TS
197 l l.
198  0      to restore default color
199  1      for brighter colors
200  4      for underlined text
201  5      for flashing text
202 30      for black foreground
203 31      for red foreground
204 32      for green foreground
205 33      for yellow (or brown) foreground
206 34      for blue foreground
207 35      for purple foreground
208 36      for cyan foreground
209 37      for white (or gray) foreground
210 40      for black background
211 41      for red background
212 42      for green background
213 43      for yellow (or brown) background
214 44      for blue background
215 45      for purple background
216 46      for cyan background
217 47      for white (or gray) background
218 .TE
219 .RE
220 .sp
221 Not all commands will work on all systems or display devices.
222 .PP
223 .B ls
224 uses the following defaults:
225 .sp
226 .TS
227 lb l l.
228 NORMAL  0               Normal (nonfilename) text
229 FILE    0               Regular file
230 DIR     32              Directory
231 LINK    36              Symbolic link
232 ORPHAN  undefined       Orphaned symbolic link
233 MISSING undefined       Missing file
234 FIFO    31              Named pipe (FIFO)
235 SOCK    33              Socket
236 BLK     44;37           Block device
237 CHR     44;37           Character device
238 EXEC    35              Executable file
239 .TE
240 .sp
241 A few terminal programs do not recognize the default
242 properly.
243 If all text gets colorized after you do a directory
244 listing, change the
245 .B NORMAL
246 and
247 .B FILE
248 codes to the numerical codes for your normal foreground and background
249 colors.
250 .SS Other terminal types (advanced configuration)
251 If you have a color-capable (or otherwise highlighting) terminal (or
252 printer!) which uses a different set of codes, you can still generate
253 a suitable setup.
254 To do so, you will have to use the
255 .BR LEFTCODE ,
256 .BR RIGHTCODE ,
257 and
258 .B ENDCODE
259 definitions.
260 .PP
261 When writing out a filename,
262 .B ls
263 generates the following output sequence:
264 .B LEFTCODE
265 .I typecode
266 .B RIGHTCODE
267 .I filename
268 .BR ENDCODE ,
269 where the
270 .I typecode
271 is the color sequence that depends on the type or name of file.
272 If the
273 .B ENDCODE
274 is undefined, the sequence
275 .B "LEFTCODE NORMAL RIGHTCODE"
276 will be used instead.
277 The purpose of the left- and rightcodes is
278 merely to reduce the amount of typing necessary (and to hide ugly
279 escape codes away from the user).
280 If they are not appropriate for
281 your terminal, you can eliminate them by specifying the respective
282 keyword on a line by itself.
283 .PP
284 .B NOTE:
285 If the
286 .B ENDCODE
287 is defined in the global section of the setup file, it
288 .I cannot
289 be undefined in a terminal-specific section of the file.
290 This means any
291 .B NORMAL
292 definition will have no effect.
293 A different
294 .B ENDCODE
295 can, however, be specified, which would have the same effect.
296 .SS Escape sequences
297 To specify control- or blank characters in the color sequences or
298 filename extensions, either C-style \e-escaped notation or
299 .BR stty \-style
300 ^-notation can be used.
301 The C-style notation
302 includes the following characters:
303 .sp
304 .RS
305 .TS
306 lb l.
307 \ea     Bell (ASCII 7)
308 \eb     Backspace (ASCII 8)
309 \ee     Escape (ASCII 27)
310 \ef     Form feed (ASCII 12)
311 \en     Newline (ASCII 10)
312 \er     Carriage Return (ASCII 13)
313 \et     Tab (ASCII 9)
314 \ev     Vertical Tab (ASCII 11)
315 \e?     Delete (ASCII 127)
316 \e\fInnn        Any character (octal notation)
317 \ex\fInnn       Any character (hexadecimal notation)
318 \e_     Space
319 \e\e    Backslash (\e)
320 \e^     Caret (^)
321 \e#     Hash mark (#)
322 .TE
323 .RE
324 .sp
325 Please note that escapes are necessary to enter a space, backslash,
326 caret, or any control character anywhere in the string, as well as a
327 hash mark as the first character.
328 .SH FILES
329 .TP
330 .I /etc/DIR_COLORS
331 System-wide configuration file.
332 .TP
333 .I ~/.dir_colors
334 Per-user configuration file.
335 .PP
336 This page describes the
337 .B dir_colors
338 file format as used in the fileutils-4.1 package;
339 other versions may differ slightly.
340 .SH NOTES
341 The default
342 .B LEFTCODE
343 and
344 .B RIGHTCODE
345 definitions, which are used by ISO 6429 terminals are:
346 .sp
347 .RS
348 .TS
349 lb l.
350 LEFTCODE        \ee[
351 RIGHTCODE       m
352 .TE
353 .RE
354 .sp
355 The default
356 .B ENDCODE
357 is undefined.
358 .SH SEE ALSO
359 .BR dircolors (1),
360 .BR ls (1),
361 .BR stty (1),
362 .BR xterm (1)