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