2 .\" Copyright (c) 2001 Martin Schulze <joey@infodrom.org>
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .TH dir_colors 5 (date) "Linux man-pages (unreleased)"
8 dir_colors \- configuration file for dircolors(1)
12 uses the environment variable
14 to determine the colors in which the filenames are to be displayed.
15 This environment variable is usually set by a command like
18 eval \`dircolors some_path/dir_colors\`
21 found in a system default shell initialization file, like
27 Usually, the file used here is
29 and can be overridden by a
31 file in one's home directory.
33 This configuration file consists of several statements, one per line.
34 Anything right of a hash mark (#) is treated as a comment, if the
35 hash mark is at the beginning of a line or is preceded by at least one
37 Blank lines are ignored.
41 section of the file consists of any statement before the first
44 Any statement in the global section of the file is
45 considered valid for all terminal types.
46 Following the global section
49 sections, preceded by one or more
51 statements which specify the terminal types (as given by the
53 environment variable) the following declarations apply to.
54 It is always possible to override a global declaration by a subsequent
55 terminal-specific one.
57 The following statements are recognized; case is insignificant:
59 .B TERM \fIterminal-type\fR
60 Starts a terminal-specific section and specifies which terminal it
64 statements can be used to create a section which applies for several
67 .B COLOR yes|all|no|none|tty
68 (Slackware only; ignored by GNU
70 Specifies that colorization should always be enabled (\fIyes\fR or
71 \fIall\fR), never enabled (\fIno\fR or \fInone\fR), or enabled only if
72 the output is a terminal (\fItty\fR).
73 The default is \fIno\fR.
76 (Slackware only; ignored by GNU
78 Specifies that eight-bit ISO 8859 characters should be enabled by
80 For compatibility reasons, this can also be specified as 1 for
81 \fIyes\fR or 0 for \fIno\fR.
82 The default is \fIno\fR.
84 .B OPTIONS \fIoptions\fR
85 (Slackware only; ignored by GNU
87 Adds command-line options to the default
90 The options can be any valid
92 command-line options, and should include the leading minus sign.
95 does not verify the validity of these options.
97 .B NORMAL \fIcolor-sequence\fR
98 Specifies the color used for normal (nonfilename) text.
103 .B FILE \fIcolor-sequence\fR
104 Specifies the color used for a regular file.
106 .B DIR \fIcolor-sequence\fR
107 Specifies the color used for directories.
109 .B LINK \fIcolor-sequence\fR
110 Specifies the color used for a symbolic link.
116 .B ORPHAN \fIcolor-sequence\fR
117 Specifies the color used for an orphaned symbolic link (one which
118 points to a nonexistent file).
119 If this is unspecified,
125 .B MISSING \fIcolor-sequence\fR
126 Specifies the color used for a missing file (a nonexistent file which
127 nevertheless has a symbolic link pointing to it).
128 If this is unspecified,
134 .B FIFO \fIcolor-sequence\fR
135 Specifies the color used for a FIFO (named pipe).
140 .B SOCK \fIcolor-sequence\fR
141 Specifies the color used for a socket.
143 .B DOOR \fIcolor-sequence\fR
144 (Supported since fileutils 4.1)
145 Specifies the color used for a door (Solaris 2.5 and later).
147 .B BLK \fIcolor-sequence\fR
148 Specifies the color used for a block device special file.
153 .B CHR \fIcolor-sequence\fR
154 Specifies the color used for a character device special file.
159 .B EXEC \fIcolor-sequence\fR
160 Specifies the color used for a file with the executable attribute set.
162 .B SUID \fIcolor-sequence\fR
163 Specifies the color used for a file with the set-user-ID attribute set.
168 .B SGID \fIcolor-sequence\fR
169 Specifies the color used for a file with the set-group-ID attribute set.
174 .B STICKY \fIcolor-sequence\fR
175 Specifies the color used for a directory with the sticky attribute set.
177 .B STICKY_OTHER_WRITABLE \fIcolor-sequence\fR
178 Specifies the color used for
179 an other-writable directory with the executable attribute set.
184 .B OTHER_WRITABLE \fIcolor-sequence\fR
185 Specifies the color used for
186 an other-writable directory without the executable attribute set.
191 .B LEFTCODE \fIcolor-sequence\fR
194 for non-ISO\ 6429 terminals (see below).
199 .B RIGHTCODE \fIcolor-sequence\fR
202 for non-ISO\ 6429 terminals (see below).
207 .B ENDCODE \fIcolor-sequence\fR
210 for non-ISO\ 6429 terminals (see below).
215 .BI * "extension color-sequence"
216 Specifies the color used for any file that ends in \fIextension\fR.
218 .BI . "extension color-sequence"
219 Same as \fB*\fR.\fIextension\fR.
220 Specifies the color used for any file that
221 ends in .\fIextension\fR.
222 Note that the period is included in the
223 extension, which makes it impossible to specify an extension not
224 starting with a period, such as
229 This form should be considered obsolete.
230 .SS ISO 6429 (ANSI) color sequences
231 Most color-capable ASCII terminals today use ISO 6429 (ANSI) color sequences,
232 and many common terminals without color capability, including
234 and the widely used and cloned DEC VT100, will recognize ISO 6429 color
235 codes and harmlessly eliminate them from the output or emulate them.
237 uses ISO 6429 codes by default, assuming colorization is enabled.
239 ISO 6429 color sequences are composed of sequences of numbers
240 separated by semicolons.
241 The most common codes are:
245 0 to restore default color
246 1 for brighter colors
247 4 for underlined text
249 30 for black foreground
250 31 for red foreground
251 32 for green foreground
252 33 for yellow (or brown) foreground
253 34 for blue foreground
254 35 for purple foreground
255 36 for cyan foreground
256 37 for white (or gray) foreground
257 40 for black background
258 41 for red background
259 42 for green background
260 43 for yellow (or brown) background
261 44 for blue background
262 45 for purple background
263 46 for cyan background
264 47 for white (or gray) background
268 Not all commands will work on all systems or display devices.
271 uses the following defaults:
274 NORMAL 0 Normal (nonfilename) text
277 LINK 36 Symbolic link
278 ORPHAN undefined Orphaned symbolic link
279 MISSING undefined Missing file
280 FIFO 31 Named pipe (FIFO)
282 BLK 44;37 Block device
283 CHR 44;37 Character device
284 EXEC 35 Executable file
287 A few terminal programs do not recognize the default
289 If all text gets colorized after you do a directory
294 codes to the numerical codes for your normal foreground and background
296 .SS Other terminal types (advanced configuration)
297 If you have a color-capable (or otherwise highlighting) terminal (or
298 printer!) which uses a different set of codes, you can still generate
300 To do so, you will have to use the
307 When writing out a filename,
309 generates the following output sequence:
317 is the color sequence that depends on the type or name of file.
320 is undefined, the sequence
321 .B "LEFTCODE NORMAL RIGHTCODE"
322 will be used instead.
323 The purpose of the left- and rightcodes is
324 merely to reduce the amount of typing necessary (and to hide ugly
325 escape codes away from the user).
326 If they are not appropriate for
327 your terminal, you can eliminate them by specifying the respective
328 keyword on a line by itself.
333 is defined in the global section of the setup file, it
335 be undefined in a terminal-specific section of the file.
338 definition will have no effect.
341 can, however, be specified, which would have the same effect.
343 To specify control- or blank characters in the color sequences or
344 filename extensions, either C-style \e-escaped notation or
346 \[ha]-notation can be used.
348 includes the following characters:
353 \eb Backspace (ASCII 8)
354 \ee Escape (ASCII 27)
355 \ef Form feed (ASCII 12)
356 \en Newline (ASCII 10)
357 \er Carriage Return (ASCII 13)
359 \ev Vertical Tab (ASCII 11)
360 \e? Delete (ASCII 127)
361 \e\fInnn Any character (octal notation)
362 \ex\fInnn Any character (hexadecimal notation)
365 \e\[ha] Caret (\[ha])
370 Note that escapes are necessary to enter a space, backslash,
371 caret, or any control character anywhere in the string, as well as a
372 hash mark as the first character.
376 System-wide configuration file.
379 Per-user configuration file.
381 This page describes the
383 file format as used in the fileutils-4.1 package;
384 other versions may differ slightly.
390 definitions, which are used by ISO 6429 terminals are: