Penguin
Blame: dir_colors(5)
EditPageHistoryDiffInfoLikePages
Annotated edit history of dir_colors(5) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 DIR_COLORS
2 !!!DIR_COLORS
3 NAME
4 DESCRIPTION
5 ISO 6429 (ANSI) COLOR SEQUENCES
6 OTHER TERMINAL TYPES (ADVANCED CONFIGURATION)
7 ESCAPE SEQUENCES
8 NOTES
9 SEE ALSO
10 FILES
11 NOTES
12 ----
13 !!NAME
14
15
16 dir_colors - configuration file for dircolors(1)
17 !!DESCRIPTION
18
19
20 The program ls(1) uses the environment variable
21 __LS_COLORS__ to determine in what color the filenames
22 should be displayed. This environment variable is usually
23 set by a command like
24
25
26 eval `dircolors some_path/dir_colors`
27
28
29 found in a system default shell initialization file, like
30 ''/etc/profile'' or ''/etc/csh.cshrc''. (See also
31 dircolors(1).) Usually, the file used here is
32 ''/etc/DIR_COLORS'' and can be overridden by a
33 ''.dir_colors'' file in one's home
34 directory.
35
36
37 This configuration file consists of several statements, one
38 per line. Anything right of a hash mark (hash mark is at the
39 beginning of a line or is preceded by at least one
40 whitespace. Blank lines are ignored.
41
42
43 The ''global'' section of the file consists of any
44 statement before the first __TERM__ statement. Any
45 statement in the global section of the file is considered
46 valid for all terminal types. Following the global section
47 is one or more ''terminal-specific'' sections, which are
48 preceded by one or more __TERM__ statements which specify
49 the terminal types (as given by the __TERM__ environment
50 variable) the following declarations apply for. It is always
51 possible to override a global declaration by a subsequent
52 terminal-specific one.
53
54
55 The following statements are recognized, case is
56 insignificant:
57
58
59 __TERM__ ''terminal-type''
60
61
62 Starts a terminal-specific section and specifies which
63 terminal it applies to. Multiple __TERM__ statements can
64 be used to create a section which applies for several
65 terminal types.
66
67
68 __COLOR yes|all|no|none|tty__
69
70
71 Specifies that colorization should be always enabled
72 (''yes'' or ''all''), never enabled (''no'' or
73 ''none'') or enabled only if the output is a terminal
74 (''tty''). The default is ''no''.
75
76
77 __EIGHTBIT yes|no__
78
79
80 Specifies that eight-bit ISO 8859 characters should be
81 enabled by default. Can for compatibility reasons also be
82 specified as 1 for ''yes'' or 0 for ''no''. The
83 default is ''no''.
84
85
86 __OPTIONS__ ''options''
87
88
89 Adds command line options to the default __ls__ command
90 line. The options can be any valid __ls__ command line
91 options, and should include the leading minus sign. Please
92 note that __dircolors__ does not verify the validity of
93 these options.
94
95
96 __NORMAL__ ''color-sequence''
97
98
99 Specifies the color used for normal (non-filename)
100 text.
101
102
103 __FILE__ ''color-sequence''
104
105
106 Specifies the color used for a regular file.
107
108
109 __DIR__ ''color-sequence''
110
111
112 Specifies the color used for directories.
113
114
115 __LINK__ ''color-sequence''
116
117
118 Specifies the color used for a symbolic link.
119
120
121 __ORPHAN__ ''color-sequence''
122
123
124 Specifies the color used for an orphanned symbolic link (one
125 which points to a nonexistent file). If this is unspecified,
126 __ls__ will use the __LINK__ color
127 instead.
128
129
130 __MISSING__ ''color-sequence''
131
132
133 Specifies the color used for a missing file (a nonexistent
134 file which nevertheless has a symbolic link pointing to it).
135 If this is unspecified, __ls__ will use the __FILE__
136 color instead.
137
138
139 __FIFO__ ''color-sequence''
140
141
142 Specifies the color used for a FIFO (named
143 pipe).
144
145
146 __SOCK__ ''color-sequence''
147
148
149 Specifies the color used for a socket.
150
151
152 __BLK__ ''color-sequence''
153
154
155 Specifies the color used for a block device special
156 file.
157
158
159 __CHR__ ''color-sequence''
160
161
162 Specifies the color used for a character device special
163 file.
164
165
166 __EXEC__ ''color-sequence''
167
168
169 Specifies the color used for a file with the executable
170 attribute set.
171
172
173 __LEFTCODE__ ''color-sequence''
174
175
176 Specifies the ''left code'' for non-ISO 6429 terminals
177 (see below).
178
179
180 __RIGHTCODE__ ''color-sequence''
181
182
183 Specifies the ''right code'' for non-ISO 6429 terminals
184 (see below).
185
186
187 __ENDCODE__ ''color-sequence''
188
189
190 Specifies the ''end code'' for non-ISO 6429 terminals
191 (see below).
192
193
194 __*__''extension color-sequence''
195
196
197 Specifies the color used for any file that ends in
198 ''extension''.
199
200
201 __.__''extension color-sequence''
202
203
204 Same as __*__.''extension''. Specifies the color used
205 for any file that ends in .''extension''. Note that the
206 period is included in the extension, which makes it
207 impossible to specify an extension not starting with a
208 period, such as __~__ for __emacs__ backup files. This
209 form should be considered obsolete.
210 !!ISO 6429 (ANSI) COLOR SEQUENCES
211
212
213 Most color-capable ASCII terminals today use ISO 6429 (ANSI)
214 color sequences, and many common terminals without color
215 capability, including __xterm__ and the widely used and
216 cloned DEC VT100, will recognize ISO 6429 color codes and
217 harmlessly eliminate them from the output or emulate them.
218 __ls__ uses ISO 6429 codes by default, assuming
219 colorization is enabled.
220
221
222 ISO 6429 color sequences are composed of sequences of
223 numbers separated by semicolons. The most common codes
224 are:
225
226
227 0 to restore default color
228 1 for brighter colors
229 4 for underlined text
230 5 for flashing text
231 30 for black foreground
232 31 for red foreground
233 32 for green foreground
234 33 for yellow (or brown) foreground
235 34 for blue foreground
236 35 for purple foreground
237 36 for cyan foreground
238 37 for white (or gray) foreground
239 40 for black background
240 41 for red background
241 42 for green background
242 43 for yellow (or brown) background
243 44 for blue background
244 45 for purple background
245 46 for cyan background
246 47 for white (or gray) background
247
248
249 Not all commands will work on all systems or display
250 devices.
251
252
253 __ls__ uses the following defaults:
254
255
256 __NORMAL__ 0 Normal (non-filename) text
257 __FILE__ 0 Regular file
258 __DIR__ 32 Directory
259 __LINK__ 36 Symbolic link
260 __ORPHAN__ undefined Orphanned symbolic link
261 __MISSING__ undefined Missing file
262 __FIFO__ 31 Named pipe (FIFO)
263 __SOCK__ 33 Socket
264 __BLK__ 44;37 Block device
265 __CHR__ 44;37 Character device
266 __EXEC__ 35 Executable file
267
268
269 A few terminal programs do not recognize the default
270 properly. If all text gets colorized after you do a
271 directory listing, change the __NORMAL__ and __FILE__
272 codes to the numerical codes for your normal foreground and
273 background colors.
274 !!OTHER TERMINAL TYPES (ADVANCED CONFIGURATION)
275
276
277 If you have a color-capable (or otherwise highlighting)
278 terminal (or printer!) which uses a different set of codes,
279 you can still generate a suitable setup. To do so you will
280 have to use the __LEFTCODE__, __RIGHTCODE__, and
281 __ENDCODE__ definitions.
282
283
284 When writing out a filename, __ls__ generates the
285 following output sequence: __LEFTCODE__ ''typecode''
286 __RIGHTCODE__ ''filename'' __ENDCODE__, where the
287 ''typecode'' is the color sequence that depends on the
288 type or name of file. If the __ENDCODE__ is undefined,
289 the sequence __LEFTCODE NORMAL RIGHTCODE__ will be used
290 instead. The purpose of the left- and rightcodes is merely
291 to reduce the amount of typing necessary (and to hide ugly
292 escape codes away from the user). If they are not
293 appropriate for your terminal, you can eliminate them by
294 specifying the respective keyword on a line by
295 itself.
296
297
298 __NOTE:__ If the __ENDCODE__ is defined in the global
299 section of the setup file, it ''cannot'' be undefined in
300 a terminal-specific section of the file. This means any
301 __NORMAL__ definition will have no effect. A different
302 __ENDCODE__ can however be specified, which would have
303 the same effect.
304 !!ESCAPE SEQUENCES
305
306
307 To specify control- or blank characters in the color
308 sequences or filename extensions, either C-style -escaped
309 notation, or __stty__-style ^-notation can be used. The
310 C-style notation includes the following
311 characters:
312
313
314 __a__ Bell (ASCII 7)
315 __b__ Backspace (ASCII 8)
316 __e__ Escape (ASCII 27)
317 __f__ Form feed (ASCII 12)
318 __n__ Newline (ASCII 10)
319 __r__ Carriage Return (ASCII 13)
320 __t__ Tab (ASCII 9)
321 __v__ Vertical Tab (ASCII 11)
322 __?__ Delete (ASCII 127)
323 __\__''nnn'' Any character (octal notation)
324 __x__''nnn'' Any character (hexadecimal notation)
325 _____ Space
326 __\__ Backslash ()
327 __^__ Caret (^)
328 __#__ Hash mark (#)
329
330
331 Please note that escapes are necessary to enter a space,
332 backslash, caret or any control character anywhere in the
333 string, as well as a hash mark as the first
334 character.
335 !!NOTES
336
337
338 The default __LEFTCODE__ and __RIGHTCODE__
339 definitions, which are used by ISO 6429 terminals
340 are:
341
342
343 __LEFTCODE__ e[[
344 __RIGHTCODE__ m
345
346
347 The default __ENDCODE__ is undefined.
348 !!SEE ALSO
349
350
351 dircolors(1), ls(1), stty(1),
352 xterm(1)
353 !!FILES
354
355
356 ''/etc/DIR_COLORS''
357
358
359 System-wide configuration file for
360 __dircolors__.
361
362
363 ''~/.dir_colors''
364
365
366 Per-user configuration file for
367 __dircolors__.
368 !!NOTES
369
370
371 This page describes the __dir_colors__ file format as
372 found in the fileutils-4.0 package; other versions may
373 differ slightly. Mail corrections and additions to
374 aeb@cwi.nl. Report bugs in the program to
375 fileutils-bugs@gnu.ai.mit.edu.
376 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.