Manpage of DIR_COLORS
DIR_COLORSSection: Linux User Manual (5)
NAMEdir_colors - configuration file for dircolors(1)
DESCRIPTIONThe program ls(1) uses the environment variable LS_COLORSto determine the colors in which the filenames are to be displayed. This environment variable is usually set by a command like
- eval `dircolors some_path/dir_colors`
found in a system default shell initialization file, like /etc/profileor /etc/csh.cshrc. (See also dircolors(1).) Usually, the file used here is /etc/DIR_COLORSand can be overridden by a .dir_colorsfile in one's home directory.
This configuration file consists of several statements, one per line. Anything right of a hash mark (#) is treated as a comment, if the hash mark is at the beginning of a line or is preceded by at least one whitespace. Blank lines are ignored.
The globalsection of the file consists of any statement before the first TERMstatement. Any statement in the global section of the file is considered valid for all terminal types. Following the global section is one or more terminal-specificsections, preceded by one or more TERMstatements which specify the terminal types (as given by the TERMenvironment variable) the following declarations apply to. It is always possible to override a global declaration by a subsequent terminal-specific one.
The following statements are recognized; case is insignificant:
- TERM terminal-type
- Starts a terminal-specific section and specifies which terminal it applies to. Multiple TERMstatements can be used to create a section which applies for several terminal types.
- COLOR yes|all|no|none|tty
- (Slackware only; ignored by GNU dircolors(1).) Specifies that colorization should always be enabled (yes or all), never enabled (no or none), or enabled only if the output is a terminal (tty). The default is no.
- EIGHTBIT yes|no
- (Slackware only; ignored by GNU dircolors(1).) Specifies that eight-bit ISO 8859 characters should be enabled by default. For compatibility reasons, this can also be specified as 1 for yes or 0 for no. The default is no.
- OPTIONS options
- (Slackware only; ignored by GNU dircolors(1).) Adds command-line options to the default lscommand line. The options can be any valid lscommand-line options, and should include the leading minus sign. Note that dircolorsdoes not verify the validity of these options.
- NORMAL color-sequence
- Specifies the color used for normal (nonfilename) text.
- FILE color-sequence
- Specifies the color used for a regular file.
- DIR color-sequence
- Specifies the color used for directories.
- LINK color-sequence
- Specifies the color used for a symbolic link.
Synonyms: LNK, SYMLINK.
- ORPHAN color-sequence
- Specifies the color used for an orphaned symbolic link (one which points to a nonexistent file). If this is unspecified, lswill use the LINKcolor instead.
- MISSING color-sequence
- Specifies the color used for a missing file (a nonexistent file which nevertheless has a symbolic link pointing to it). If this is unspecified, lswill use the FILEcolor instead.
- FIFO color-sequence
- Specifies the color used for a FIFO (named pipe).
- SOCK color-sequence
- Specifies the color used for a socket.
- DOOR color-sequence
- (Supported since fileutils 4.1) Specifies the color used for a door (Solaris 2.5 and later).
- BLK color-sequence
- Specifies the color used for a block device special file.
- CHR color-sequence
- Specifies the color used for a character device special file.
- EXEC color-sequence
- Specifies the color used for a file with the executable attribute set.
- SUID color-sequence
- Specifies the color used for a file with the set-user-ID attribute set.
- SGID color-sequence
- Specifies the color used for a file with the set-group-ID attribute set.
- STICKY color-sequence
- Specifies the color used for a directory with the sticky attribute set.
- STICKY_OTHER_WRITABLE color-sequence
- Specifies the color used for a other-writable directory with the executable attribute set.
- OTHER_WRITABLE color-sequence
- Specifies the color used for a other-writable directory without the executable attribute set.
- LEFTCODE color-sequence
- Specifies the
left codefor non-ISO 6429 terminals (see below).
- RIGHTCODE color-sequence
- Specifies the
right codefor non-ISO 6429 terminals (see below).
- ENDCODE color-sequence
- Specifies the
end codefor non-ISO 6429 terminals (see below).
- *extension color-sequence
- Specifies the color used for any file that ends in extension.
- .extension color-sequence
- Same as *.extension. Specifies the color used for any file that ends in .extension. Note that the period is included in the extension, which makes it impossible to specify an extension not starting with a period, such as ~for emacsbackup files. This form should be considered obsolete.
ISO 6429 (ANSI) color sequencesMost color-capable ASCII terminals today use ISO 6429 (ANSI) color sequences, and many common terminals without color capability, including xtermand the widely used and cloned DEC VT100, will recognize ISO 6429 color codes and harmlessly eliminate them from the output or emulate them. lsuses ISO 6429 codes by default, assuming colorization is enabled.
ISO 6429 color sequences are composed of sequences of numbers separated by semicolons. The most common codes are:
to restore default color
for brighter colors
for underlined text
for flashing text 30 for black foreground 31 for red foreground 32 for green foreground 33 for yellow (or brown) foreground 34 for blue foreground 35 for purple foreground 36 for cyan foreground 37 for white (or gray) foreground 40 for black background 41 for red background 42 for green background 43 for yellow (or brown) background 44 for blue background 45 for purple background 46 for cyan background 47 for white (or gray) background
Not all commands will work on all systems or display devices.
lsuses the following defaults:
|NORMAL||0||Normal (nonfilename) text|
|ORPHAN||undefined||Orphaned symbolic link|
|FIFO||31||Named pipe (FIFO)|
A few terminal programs do not recognize the default properly. If all text gets colorized after you do a directory listing, change the NORMALand FILEcodes to the numerical codes for your normal foreground and background colors.
Other terminal types (advanced configuration)If you have a color-capable (or otherwise highlighting) terminal (or printer!) which uses a different set of codes, you can still generate a suitable setup. To do so, you will have to use the LEFTCODE, RIGHTCODE, and ENDCODEdefinitions.
When writing out a filename, lsgenerates the following output sequence: LEFTCODEtypecodeRIGHTCODEfilenameENDCODE, where the typecodeis the color sequence that depends on the type or name of file. If the ENDCODEis undefined, the sequence LEFTCODE NORMAL RIGHTCODEwill be used instead. The purpose of the left- and rightcodes is merely to reduce the amount of typing necessary (and to hide ugly escape codes away from the user). If they are not appropriate for your terminal, you can eliminate them by specifying the respective keyword on a line by itself.
NOTE:If the ENDCODEis defined in the global section of the setup file, it cannotbe undefined in a terminal-specific section of the file. This means any NORMALdefinition will have no effect. A different ENDCODEcan, however, be specified, which would have the same effect.
Escape sequencesTo specify control- or blank characters in the color sequences or filename extensions, either C-style \-escaped notation or stty-style ^-notation can be used. The C-style notation includes the following characters:
\a Bell (ASCII 7) \b Backspace (ASCII 8) \e Escape (ASCII 27) \f Form feed (ASCII 12) \n Newline (ASCII 10) \r Carriage Return (ASCII 13) \t Tab (ASCII 9) \v Vertical Tab (ASCII 11) \? Delete (ASCII 127) \nnn Any character (octal notation) \xnnn Any character (hexadecimal notation) \_ Space \\ Backslash (\) \^ Caret (^) \# Hash mark (#)
- System-wide configuration file.
- Per-user configuration file.
NOTESThe default LEFTCODEand RIGHTCODEdefinitions, which are used by ISO 6429 terminals are:
LEFTCODE \e[ RIGHTCODE m
SEE ALSOdircolors(1), ls(1), stty(1), xterm(1)
- SEE ALSO
This document was created by man2html, using the manual pages.
Time: 22:28:02 GMT, June 20, 2016