]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/dir_colors.5
time.1, atexit.3, bsearch.3, dlopen.3, envz_add.3, errno.3, fmtmsg.3, getgrent_r...
[thirdparty/man-pages.git] / man5 / dir_colors.5
CommitLineData
c13182ef 1.\"
fea681da
MK
2.\" manpage for /etc/dir_colors, config file for dircolors(1)
3.\" extracted from color-ls 3.12.0.3 dircolors(1) manpage
4.\"
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.
8.\"
9.\" Modified Sat Dec 22 22:25:33 2001 by Martin Schulze <joey@infodrom.org>
10.\"
05eabe65 11.TH DIR_COLORS 5 2001-12-26 "GNU" "Linux User Manual"
fea681da
MK
12.SH NAME
13dir_colors \- configuration file for dircolors(1)
14.SH DESCRIPTION
15The program
16.BR ls (1)
17uses the environment variable
18.B LS_COLORS
19to determine the colors in which the filenames are to be displayed.
20This environment variable is usually set by a command like
21
22.RS
26868e5b 23eval \`dircolors some_path/dir_colors\`
fea681da
MK
24.RE
25
26found in a system default shell initialization file, like
27.I /etc/profile
28or
29.IR /etc/csh.cshrc .
30(See also
31.BR dircolors (1).)
32Usually, the file used here is
33.I /etc/DIR_COLORS
34and can be overridden by a
35.I .dir_colors
36file in one's home directory.
37.PP
38This configuration file consists of several statements, one per line.
39Anything right of a hash mark (#) is treated as a comment, if the
40hash mark is at the beginning of a line or is preceded by at least one
c13182ef
MK
41whitespace.
42Blank lines are ignored.
fea681da
MK
43.PP
44The
45.I global
46section of the file consists of any statement before the first
47.B TERM
c13182ef
MK
48statement.
49Any statement in the global section of the file is
50considered valid for all terminal types.
51Following the global section
52is one or more
fea681da
MK
53.I terminal-specific
54sections, preceded by one or more
55.B TERM
56statements which specify the terminal types (as given by the
57.B TERM
c13182ef
MK
58environment variable) the following declarations apply to.
59It is always possible to override a global declaration by a subsequent
fea681da
MK
60terminal-specific one.
61.PP
62The following statements are recognized; case is insignificant:
fea681da
MK
63.TP
64.B TERM \fIterminal-type\fR
65Starts a terminal-specific section and specifies which terminal it
c13182ef
MK
66applies to.
67Multiple
fea681da
MK
68.B TERM
69statements can be used to create a section which applies for several
70terminal types.
71.TP
72.B COLOR yes|all|no|none|tty
73(Slackware only; ignored by GNU
74.BR dircolors (1).)
75Specifies that colorization should always be enabled (\fIyes\fR or
76\fIall\fR), never enabled (\fIno\fR or \fInone\fR), or enabled only if
c13182ef
MK
77the output is a terminal (\fItty\fR).
78The default is \fIno\fR.
fea681da
MK
79.TP
80.B EIGHTBIT yes|no
81(Slackware only; ignored by GNU
82.BR dircolors (1).)
83Specifies that eight-bit ISO 8859 characters should be enabled by
c13182ef
MK
84default.
85For compatibility reasons, this can also be specified as 1 for
86\fIyes\fR or 0 for \fIno\fR.
87The default is \fIno\fR.
fea681da
MK
88.TP
89.B OPTIONS \fIoptions\fR
90(Slackware only; ignored by GNU
91.BR dircolors (1).)
76c44d83 92Adds command-line options to the default
fea681da 93.B ls
c13182ef
MK
94command line.
95The options can be any valid
fea681da 96.B ls
76c44d83 97command-line options, and should include the leading minus sign.
1de3e6ad 98Note that
fea681da
MK
99.B dircolors
100does not verify the validity of these options.
101.TP
102.B NORMAL \fIcolor-sequence\fR
24b74457 103Specifies the color used for normal (nonfilename) text.
fea681da
MK
104.TP
105.B FILE \fIcolor-sequence\fR
106Specifies the color used for a regular file.
107.TP
108.B DIR \fIcolor-sequence\fR
109Specifies the color used for directories.
110.TP
111.B LINK \fIcolor-sequence\fR
112Specifies the color used for a symbolic link.
113.TP
114.B ORPHAN \fIcolor-sequence\fR
115Specifies the color used for an orphaned symbolic link (one which
c13182ef
MK
116points to a nonexistent file).
117If this is unspecified,
fea681da
MK
118.B ls
119will use the
120.B LINK
121color instead.
122.TP
123.B MISSING \fIcolor-sequence\fR
124Specifies the color used for a missing file (a nonexistent file which
c13182ef
MK
125nevertheless has a symbolic link pointing to it).
126If this is unspecified,
fea681da
MK
127.B ls
128will use the
129.B FILE
130color instead.
131.TP
132.B FIFO \fIcolor-sequence\fR
133Specifies the color used for a FIFO (named pipe).
134.TP
135.B SOCK \fIcolor-sequence\fR
136Specifies the color used for a socket.
137.TP
138.B DOOR \fIcolor-sequence\fR
0af06fef 139(Supported since fileutils 4.1)
fea681da
MK
140Specifies the color used for a door (Solaris 2.5 and later).
141.TP
142.B BLK \fIcolor-sequence\fR
143Specifies the color used for a block device special file.
144.TP
145.B CHR \fIcolor-sequence\fR
146Specifies the color used for a character device special file.
147.TP
148.B EXEC \fIcolor-sequence\fR
149Specifies the color used for a file with the executable attribute set.
150.TP
151.B LEFTCODE \fIcolor-sequence\fR
152Specifies the
153.I "left code"
154for non-ISO\ 6429 terminals (see below).
155.TP
156.B RIGHTCODE \fIcolor-sequence\fR
157Specifies the
158.I "right code"
159for non-ISO\ 6429 terminals (see below).
160.TP
161.B ENDCODE \fIcolor-sequence\fR
162Specifies the
163.I "end code"
164for non-ISO\ 6429 terminals (see below).
165.TP
166\fB*\fIextension\fR \fIcolor-sequence\fR
167Specifies the color used for any file that ends in \fIextension\fR.
168.TP
169\fB .\fIextension\fR \fIcolor-sequence\fR
c13182ef
MK
170Same as \fB*\fR.\fIextension\fR.
171Specifies the color used for any file that
172ends in .\fIextension\fR.
173Note that the period is included in the
fea681da
MK
174extension, which makes it impossible to specify an extension not
175starting with a period, such as
176.B ~
177for
178.B emacs
c13182ef
MK
179backup files.
180This form should be considered obsolete.
2b2581ee 181.SS "ISO 6429 (ANSI) Color Sequences"
fea681da
MK
182Most color-capable ASCII terminals today use ISO 6429 (ANSI) color sequences,
183and many common terminals without color capability, including
184.B xterm
185and the widely used and cloned DEC VT100, will recognize ISO 6429 color
186codes and harmlessly eliminate them from the output or emulate them.
187.B ls
188uses ISO 6429 codes by default, assuming colorization is enabled.
189
190ISO 6429 color sequences are composed of sequences of numbers
c13182ef
MK
191separated by semicolons.
192The most common codes are:
fea681da
MK
193.sp
194.RS +.2i
195.ta 1.0i
196.nf
197 0 to restore default color
c13182ef 198 1 for brighter colors
fea681da
MK
199 4 for underlined text
200 5 for flashing text
20130 for black foreground
20231 for red foreground
20332 for green foreground
20433 for yellow (or brown) foreground
20534 for blue foreground
20635 for purple foreground
20736 for cyan foreground
20837 for white (or gray) foreground
20940 for black background
21041 for red background
21142 for green background
21243 for yellow (or brown) background
21344 for blue background
21445 for purple background
21546 for cyan background
21647 for white (or gray) background
217.fi
218.RE
219.sp
220Not all commands will work on all systems or display devices.
221.PP
222.B ls
223uses the following defaults:
224.sp
225.RS +.2i
226.ta 1.0i 2.5i
227.nf
24b74457 228\fBNORMAL\fR 0 Normal (nonfilename) text
fea681da
MK
229\fBFILE\fR 0 Regular file
230\fBDIR\fR 32 Directory
231\fBLINK\fR 36 Symbolic link
9fdfa163 232\fBORPHAN\fR undefined Orphaned symbolic link
fea681da
MK
233\fBMISSING\fR undefined Missing file
234\fBFIFO\fR 31 Named pipe (FIFO)
235\fBSOCK\fR 33 Socket
236\fBBLK\fR 44;37 Block device
237\fBCHR\fR 44;37 Character device
238\fBEXEC\fR 35 Executable file
239.fi
240.RE
241.sp
c13182ef
MK
242A few terminal programs do not recognize the default
243properly.
244If all text gets colorized after you do a directory
fea681da
MK
245listing, change the
246.B NORMAL
247and
248.B FILE
249codes to the numerical codes for your normal foreground and background
250colors.
2b2581ee 251.SS "Other Terminal Types (Advanced Configuration)"
fea681da
MK
252If you have a color-capable (or otherwise highlighting) terminal (or
253printer!) which uses a different set of codes, you can still generate
c13182ef
MK
254a suitable setup.
255To do so, you will have to use the
fea681da
MK
256.BR LEFTCODE ,
257.BR RIGHTCODE ,
258and
0daa9e92 259.B ENDCODE
fea681da
MK
260definitions.
261.PP
262When writing out a filename,
263.B ls
264generates the following output sequence:
265.B LEFTCODE
266.I typecode
267.B RIGHTCODE
268.I filename
269.BR ENDCODE ,
270where the
271.I typecode
c13182ef
MK
272is the color sequence that depends on the type or name of file.
273If the
fea681da
MK
274.B ENDCODE
275is undefined, the sequence
276.B "LEFTCODE NORMAL RIGHTCODE"
c13182ef
MK
277will be used instead.
278The purpose of the left- and rightcodes is
fea681da 279merely to reduce the amount of typing necessary (and to hide ugly
c13182ef
MK
280escape codes away from the user).
281If they are not appropriate for
fea681da
MK
282your terminal, you can eliminate them by specifying the respective
283keyword on a line by itself.
284.PP
285.B NOTE:
286If the
287.B ENDCODE
288is defined in the global section of the setup file, it
289.I cannot
c13182ef
MK
290be undefined in a terminal-specific section of the file.
291This means any
fea681da 292.B NORMAL
c13182ef
MK
293definition will have no effect.
294A different
fea681da
MK
295.B ENDCODE
296can, however, be specified, which would have the same effect.
2b2581ee 297.SS "Escape Sequences"
fea681da 298To specify control- or blank characters in the color sequences or
9f8e673e 299filename extensions, either C-style \\-escaped notation or
4d9b6984 300.BR stty \-style
c13182ef
MK
301^-notation can be used.
302The C-style notation
fea681da
MK
303includes the following characters:
304.sp
305.RS +.2i
306.ta 1.0i
307.nf
9f8e673e
MK
308\fB\\a\fR Bell (ASCII 7)
309\fB\\b\fR Backspace (ASCII 8)
310\fB\\e\fR Escape (ASCII 27)
311\fB\\f\fR Form feed (ASCII 12)
312\fB\\n\fR Newline (ASCII 10)
313\fB\\r\fR Carriage Return (ASCII 13)
314\fB\\t\fR Tab (ASCII 9)
315\fB\\v\fR Vertical Tab (ASCII 11)
316\fB\\?\fR Delete (ASCII 127)
317\fB\\\fInnn\fR Any character (octal notation)
318\fB\\x\fInnn\fR Any character (hexadecimal notation)
319\fB\\_\fR Space
320\fB\\\\\fR Backslash (\\)
321\fB\\^\fR Caret (^)
322\fB\\#\fR Hash mark (#)
fea681da
MK
323.fi
324.RE
325.sp
326Please note that escapes are necessary to enter a space, backslash,
327caret, or any control character anywhere in the string, as well as a
328hash mark as the first character.
2b2581ee
MK
329.SH FILES
330.TP
331.I /etc/DIR_COLORS
332System-wide configuration file.
333.TP
334.I ~/.dir_colors
335Per-user configuration file.
336.PP
337This page describes the
338.B dir_colors
339file format as used in the fileutils-4.1 package;
340other versions may differ slightly.
fea681da
MK
341.SH NOTES
342The default
343.B LEFTCODE
344and
345.B RIGHTCODE
346definitions, which are used by ISO 6429 terminals are:
347.sp
348.RS +.2i
349.ta 1.0i
350.nf
9f8e673e 351\fBLEFTCODE\fR \\e[
fea681da
MK
352\fBRIGHTCODE\fR m
353.fi
354.RE
355.sp
356The default
357.B ENDCODE
358is undefined.
e37e3282
MK
359.SH "SEE ALSO"
360.BR dircolors (1),
361.BR ls (1),
362.BR stty (1),
363.BR xterm (1)