1 .\" manpage for /etc/dir_colors, config file for dircolors(1)
2 .\" extracted from color-ls 3.12.0.3 dircolors(1) manpage
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.
10 .\" Modified Sat Dec 22 22:25:33 2001 by Martin Schulze <joey@infodrom.org>
12 .TH DIR_COLORS 5 2020-08-13 "GNU" "Linux User Manual"
14 dir_colors \- configuration file for dircolors(1)
18 uses the environment variable
20 to determine the colors in which the filenames are to be displayed.
21 This environment variable is usually set by a command like
24 eval \`dircolors some_path/dir_colors\`
27 found in a system default shell initialization file, like
33 Usually, the file used here is
35 and can be overridden by a
37 file in one's home directory.
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
43 Blank lines are ignored.
47 section of the file consists of any statement before the first
50 Any statement in the global section of the file is
51 considered valid for all terminal types.
52 Following the global section
55 sections, preceded by one or more
57 statements which specify the terminal types (as given by the
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.
63 The following statements are recognized; case is insignificant:
65 .B TERM \fIterminal-type\fR
66 Starts a terminal-specific section and specifies which terminal it
70 statements can be used to create a section which applies for several
73 .B COLOR yes|all|no|none|tty
74 (Slackware only; ignored by GNU
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.
82 (Slackware only; ignored by GNU
84 Specifies that eight-bit ISO 8859 characters should be enabled by
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.
90 .B OPTIONS \fIoptions\fR
91 (Slackware only; ignored by GNU
93 Adds command-line options to the default
96 The options can be any valid
98 command-line options, and should include the leading minus sign.
101 does not verify the validity of these options.
103 .B NORMAL \fIcolor-sequence\fR
104 Specifies the color used for normal (nonfilename) text.
109 .B FILE \fIcolor-sequence\fR
110 Specifies the color used for a regular file.
112 .B DIR \fIcolor-sequence\fR
113 Specifies the color used for directories.
115 .B LINK \fIcolor-sequence\fR
116 Specifies the color used for a symbolic link.
122 .B ORPHAN \fIcolor-sequence\fR
123 Specifies the color used for an orphaned symbolic link (one which
124 points to a nonexistent file).
125 If this is unspecified,
131 .B MISSING \fIcolor-sequence\fR
132 Specifies the color used for a missing file (a nonexistent file which
133 nevertheless has a symbolic link pointing to it).
134 If this is unspecified,
140 .B FIFO \fIcolor-sequence\fR
141 Specifies the color used for a FIFO (named pipe).
146 .B SOCK \fIcolor-sequence\fR
147 Specifies the color used for a socket.
149 .B DOOR \fIcolor-sequence\fR
150 (Supported since fileutils 4.1)
151 Specifies the color used for a door (Solaris 2.5 and later).
153 .B BLK \fIcolor-sequence\fR
154 Specifies the color used for a block device special file.
159 .B CHR \fIcolor-sequence\fR
160 Specifies the color used for a character device special file.
165 .B EXEC \fIcolor-sequence\fR
166 Specifies the color used for a file with the executable attribute set.
168 .B SUID \fIcolor-sequence\fR
169 Specifies the color used for a file with the set-user-ID attribute set.
174 .B SGID \fIcolor-sequence\fR
175 Specifies the color used for a file with the set-group-ID attribute set.
180 .B STICKY \fIcolor-sequence\fR
181 Specifies the color used for a directory with the sticky attribute set.
183 .B STICKY_OTHER_WRITABLE \fIcolor-sequence\fR
184 Specifies the color used for an other-writable directory with the executable attribute set.
189 .B OTHER_WRITABLE \fIcolor-sequence\fR
190 Specifies the color used for an other-writable directory without the executable attribute set.
195 .B LEFTCODE \fIcolor-sequence\fR
198 for non-ISO\ 6429 terminals (see below).
203 .B RIGHTCODE \fIcolor-sequence\fR
206 for non-ISO\ 6429 terminals (see below).
211 .B ENDCODE \fIcolor-sequence\fR
214 for non-ISO\ 6429 terminals (see below).
219 .BI * "extension color-sequence"
220 Specifies the color used for any file that ends in \fIextension\fR.
222 .BI . "extension color-sequence"
223 Same as \fB*\fR.\fIextension\fR.
224 Specifies the color used for any file that
225 ends in .\fIextension\fR.
226 Note that the period is included in the
227 extension, which makes it impossible to specify an extension not
228 starting with a period, such as
233 This form should be considered obsolete.
234 .SS ISO 6429 (ANSI) color sequences
235 Most color-capable ASCII terminals today use ISO 6429 (ANSI) color sequences,
236 and many common terminals without color capability, including
238 and the widely used and cloned DEC VT100, will recognize ISO 6429 color
239 codes and harmlessly eliminate them from the output or emulate them.
241 uses ISO 6429 codes by default, assuming colorization is enabled.
243 ISO 6429 color sequences are composed of sequences of numbers
244 separated by semicolons.
245 The most common codes are:
249 0 to restore default color
250 1 for brighter colors
251 4 for underlined text
253 30 for black foreground
254 31 for red foreground
255 32 for green foreground
256 33 for yellow (or brown) foreground
257 34 for blue foreground
258 35 for purple foreground
259 36 for cyan foreground
260 37 for white (or gray) foreground
261 40 for black background
262 41 for red background
263 42 for green background
264 43 for yellow (or brown) background
265 44 for blue background
266 45 for purple background
267 46 for cyan background
268 47 for white (or gray) background
272 Not all commands will work on all systems or display devices.
275 uses the following defaults:
278 NORMAL 0 Normal (nonfilename) text
281 LINK 36 Symbolic link
282 ORPHAN undefined Orphaned symbolic link
283 MISSING undefined Missing file
284 FIFO 31 Named pipe (FIFO)
286 BLK 44;37 Block device
287 CHR 44;37 Character device
288 EXEC 35 Executable file
291 A few terminal programs do not recognize the default
293 If all text gets colorized after you do a directory
298 codes to the numerical codes for your normal foreground and background
300 .SS Other terminal types (advanced configuration)
301 If you have a color-capable (or otherwise highlighting) terminal (or
302 printer!) which uses a different set of codes, you can still generate
304 To do so, you will have to use the
311 When writing out a filename,
313 generates the following output sequence:
321 is the color sequence that depends on the type or name of file.
324 is undefined, the sequence
325 .B "LEFTCODE NORMAL RIGHTCODE"
326 will be used instead.
327 The purpose of the left- and rightcodes is
328 merely to reduce the amount of typing necessary (and to hide ugly
329 escape codes away from the user).
330 If they are not appropriate for
331 your terminal, you can eliminate them by specifying the respective
332 keyword on a line by itself.
337 is defined in the global section of the setup file, it
339 be undefined in a terminal-specific section of the file.
342 definition will have no effect.
345 can, however, be specified, which would have the same effect.
347 To specify control- or blank characters in the color sequences or
348 filename extensions, either C-style \e-escaped notation or
350 \(ha-notation can be used.
352 includes the following characters:
357 \eb Backspace (ASCII 8)
358 \ee Escape (ASCII 27)
359 \ef Form feed (ASCII 12)
360 \en Newline (ASCII 10)
361 \er Carriage Return (ASCII 13)
363 \ev Vertical Tab (ASCII 11)
364 \e? Delete (ASCII 127)
365 \e\fInnn Any character (octal notation)
366 \ex\fInnn Any character (hexadecimal notation)
374 Note that escapes are necessary to enter a space, backslash,
375 caret, or any control character anywhere in the string, as well as a
376 hash mark as the first character.
380 System-wide configuration file.
383 Per-user configuration file.
385 This page describes the
387 file format as used in the fileutils-4.1 package;
388 other versions may differ slightly.
394 definitions, which are used by ISO 6429 terminals are: