]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/dir_colors.5
All pages: Remove the 5th argument to .TH
[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.\"
45186a5d 12.TH DIR_COLORS 5 2020-08-13 "Linux man-pages (unreleased)"
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
15f0b7af
AC
184Specifies the color used for
185an other-writable directory with the executable attribute set.
2dad4c59 186.IP
09d3c20c
MK
187Synonym:
188.BR OWT .
7f0c47f0
SP
189.TP
190.B OTHER_WRITABLE \fIcolor-sequence\fR
15f0b7af
AC
191Specifies the color used for
192an other-writable directory without the executable attribute set.
2dad4c59 193.IP
09d3c20c
MK
194Synonym:
195.BR OWR .
7f0c47f0 196.TP
fea681da
MK
197.B LEFTCODE \fIcolor-sequence\fR
198Specifies the
199.I "left code"
200for non-ISO\ 6429 terminals (see below).
2dad4c59 201.IP
09d3c20c
MK
202Synonym:
203.BR LEFT .
fea681da
MK
204.TP
205.B RIGHTCODE \fIcolor-sequence\fR
206Specifies the
207.I "right code"
208for non-ISO\ 6429 terminals (see below).
2dad4c59 209.IP
09d3c20c
MK
210Synonym:
211.BR RIGHT .
fea681da
MK
212.TP
213.B ENDCODE \fIcolor-sequence\fR
214Specifies the
215.I "end code"
216for non-ISO\ 6429 terminals (see below).
2dad4c59 217.IP
09d3c20c
MK
218Synonym:
219.BR END .
fea681da 220.TP
1ae6b2c7 221.BI * "extension color-sequence"
fea681da
MK
222Specifies the color used for any file that ends in \fIextension\fR.
223.TP
1ae6b2c7 224.BI . "extension color-sequence"
c13182ef
MK
225Same as \fB*\fR.\fIextension\fR.
226Specifies the color used for any file that
227ends in .\fIextension\fR.
228Note that the period is included in the
fea681da
MK
229extension, which makes it impossible to specify an extension not
230starting with a period, such as
af2d18b2 231.B \(ti
fea681da
MK
232for
233.B emacs
c13182ef
MK
234backup files.
235This form should be considered obsolete.
73d8cece 236.SS ISO 6429 (ANSI) color sequences
fea681da
MK
237Most color-capable ASCII terminals today use ISO 6429 (ANSI) color sequences,
238and many common terminals without color capability, including
239.B xterm
240and the widely used and cloned DEC VT100, will recognize ISO 6429 color
241codes and harmlessly eliminate them from the output or emulate them.
242.B ls
243uses ISO 6429 codes by default, assuming colorization is enabled.
2dad4c59 244.PP
fea681da 245ISO 6429 color sequences are composed of sequences of numbers
c13182ef
MK
246separated by semicolons.
247The most common codes are:
7bc8e428
ER
248.RS
249.TS
250l l.
251 0 to restore default color
252 1 for brighter colors
253 4 for underlined text
254 5 for flashing text
25530 for black foreground
25631 for red foreground
25732 for green foreground
25833 for yellow (or brown) foreground
25934 for blue foreground
26035 for purple foreground
26136 for cyan foreground
26237 for white (or gray) foreground
26340 for black background
26441 for red background
26542 for green background
26643 for yellow (or brown) background
26744 for blue background
26845 for purple background
26946 for cyan background
27047 for white (or gray) background
271.TE
fea681da 272.RE
6545cc56 273.PP
fea681da
MK
274Not all commands will work on all systems or display devices.
275.PP
276.B ls
277uses the following defaults:
7bc8e428
ER
278.TS
279lb l l.
280NORMAL 0 Normal (nonfilename) text
281FILE 0 Regular file
282DIR 32 Directory
283LINK 36 Symbolic link
284ORPHAN undefined Orphaned symbolic link
285MISSING undefined Missing file
286FIFO 31 Named pipe (FIFO)
287SOCK 33 Socket
288BLK 44;37 Block device
289CHR 44;37 Character device
290EXEC 35 Executable file
291.TE
6545cc56 292.PP
c13182ef
MK
293A few terminal programs do not recognize the default
294properly.
295If all text gets colorized after you do a directory
fea681da
MK
296listing, change the
297.B NORMAL
298and
299.B FILE
300codes to the numerical codes for your normal foreground and background
301colors.
73d8cece 302.SS Other terminal types (advanced configuration)
fea681da
MK
303If you have a color-capable (or otherwise highlighting) terminal (or
304printer!) which uses a different set of codes, you can still generate
c13182ef
MK
305a suitable setup.
306To do so, you will have to use the
fea681da
MK
307.BR LEFTCODE ,
308.BR RIGHTCODE ,
309and
0daa9e92 310.B ENDCODE
fea681da
MK
311definitions.
312.PP
313When writing out a filename,
314.B ls
315generates the following output sequence:
316.B LEFTCODE
317.I typecode
318.B RIGHTCODE
319.I filename
320.BR ENDCODE ,
321where the
322.I typecode
c13182ef
MK
323is the color sequence that depends on the type or name of file.
324If the
fea681da
MK
325.B ENDCODE
326is undefined, the sequence
327.B "LEFTCODE NORMAL RIGHTCODE"
c13182ef
MK
328will be used instead.
329The purpose of the left- and rightcodes is
fea681da 330merely to reduce the amount of typing necessary (and to hide ugly
c13182ef
MK
331escape codes away from the user).
332If they are not appropriate for
fea681da
MK
333your terminal, you can eliminate them by specifying the respective
334keyword on a line by itself.
335.PP
336.B NOTE:
337If the
338.B ENDCODE
339is defined in the global section of the setup file, it
340.I cannot
c13182ef
MK
341be undefined in a terminal-specific section of the file.
342This means any
fea681da 343.B NORMAL
c13182ef
MK
344definition will have no effect.
345A different
fea681da
MK
346.B ENDCODE
347can, however, be specified, which would have the same effect.
73d8cece 348.SS Escape sequences
fea681da 349To specify control- or blank characters in the color sequences or
31a6818e 350filename extensions, either C-style \e-escaped notation or
4d9b6984 351.BR stty \-style
9ca13180 352\(ha-notation can be used.
c13182ef 353The C-style notation
fea681da 354includes the following characters:
7bc8e428
ER
355.RS
356.TS
357lb l.
358\ea Bell (ASCII 7)
359\eb Backspace (ASCII 8)
360\ee Escape (ASCII 27)
361\ef Form feed (ASCII 12)
362\en Newline (ASCII 10)
363\er Carriage Return (ASCII 13)
364\et Tab (ASCII 9)
365\ev Vertical Tab (ASCII 11)
366\e? Delete (ASCII 127)
367\e\fInnn Any character (octal notation)
368\ex\fInnn Any character (hexadecimal notation)
369\e_ Space
370\e\e Backslash (\e)
9ca13180 371\e\(ha Caret (\(ha)
7bc8e428
ER
372\e# Hash mark (#)
373.TE
fea681da 374.RE
6545cc56 375.PP
f122e7a1 376Note that escapes are necessary to enter a space, backslash,
fea681da
MK
377caret, or any control character anywhere in the string, as well as a
378hash mark as the first character.
2b2581ee
MK
379.SH FILES
380.TP
381.I /etc/DIR_COLORS
382System-wide configuration file.
383.TP
af2d18b2 384.I \(ti/.dir_colors
2b2581ee
MK
385Per-user configuration file.
386.PP
387This page describes the
388.B dir_colors
389file format as used in the fileutils-4.1 package;
390other versions may differ slightly.
fea681da
MK
391.SH NOTES
392The default
393.B LEFTCODE
394and
395.B RIGHTCODE
396definitions, which are used by ISO 6429 terminals are:
7bc8e428
ER
397.RS
398.TS
399lb l.
400LEFTCODE \ee[
401RIGHTCODE m
402.TE
fea681da 403.RE
6545cc56 404.PP
fea681da
MK
405The default
406.B ENDCODE
407is undefined.
47297adb 408.SH SEE ALSO
e37e3282
MK
409.BR dircolors (1),
410.BR ls (1),
411.BR stty (1),
412.BR xterm (1)