# dir_colors - configuration file for dircolors(1) - man(5) - [phpMan]

[_dir_colors_(5)](https://www.chedong.com/phpMan.php/man/dircolors/5/markdown)                            File Formats Manual                           [_dir_colors_(5)](https://www.chedong.com/phpMan.php/man/dircolors/5/markdown)

## NAME
       dir_colors - configuration file for [dircolors(1)](https://www.chedong.com/phpMan.php/man/dircolors/1/markdown)

## DESCRIPTION
       The  program  [**ls**(1)](https://www.chedong.com/phpMan.php/man/ls/1/markdown)  uses the environment variable **LS_COLORS **to 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/profile_ or _/etc/csh.cshrc_.
       (See also [**dircolors**(1)](https://www.chedong.com/phpMan.php/man/dircolors/1/markdown).)  Usually, the file used here is _/etc/DIR_COLORS_ and can be  overrid‐
       den by a _.dir_colors_ file 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  _global_  section  of  the file consists of any statement before the first **TERM **statement.
       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-specific_ sections, preceded by one or
       more **TERM **statements which specify the terminal types (as given by the **TERM **environment vari‐
       able) the following declarations apply to.  It is always possible to override a global decla‐
       ration 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.  Multi‐
              ple **TERM **statements 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)](https://www.chedong.com/phpMan.php/man/dircolors/1/markdown).)  Specifies that colorization should al‐
              ways be enabled (_yes_ or _all_), never enabled (_no_ or _none_), or enabled only if the  out‐
              put is a terminal (_tty_).  The default is _no_.

### EIGHTBIT yes|no
              (Slackware  only; ignored by GNU [**dircolors**(1)](https://www.chedong.com/phpMan.php/man/dircolors/1/markdown).)  Specifies that eight-bit ISO/IEC 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)](https://www.chedong.com/phpMan.php/man/dircolors/1/markdown).)  Adds command-line options to the de‐
              fault **ls **command line.  The options can be any  valid  **ls  **command-line  options,  and
              should include the leading minus sign.  Note that **dircolors **does not verify the valid‐
              ity of these options.

       **NORMAL _**color-sequence_
              Specifies the color used for normal (nonfilename) text.

              Synonym: **NORM**.

       **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 nonexis‐
              tent file).  If this is unspecified, **ls **will use the **LINK **color 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, **ls **will use the **FILE **color
              instead.

       **FIFO _**color-sequence_
              Specifies the color used for a FIFO (named pipe).

              Synonym: **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.

              Synonym: **BLOCK**.

       **CHR _**color-sequence_
              Specifies the color used for a character device special file.

              Synonym: **CHAR**.

       **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.

              Synonym: **SETUID**.

       **SGID _**color-sequence_
              Specifies the color used for a file with the set-group-ID attribute set.

              Synonym: **SETGID**.

       **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 an other-writable directory with the executable attribute
              set.

              Synonym: **OWT**.

       **OTHER_WRITABLE _**color-sequence_
              Specifies  the  color  used for an other-writable directory without the executable at‐
              tribute set.

              Synonym: **OWR**.

       **LEFTCODE _**color-sequence_
              Specifies the _left_ _code_ for non-ISO/IEC 6429 terminals (see below).

              Synonym: **LEFT**.

       **RIGHTCODE _**color-sequence_
              Specifies the _right_ _code_ for non-ISO/IEC 6429 terminals (see below).

              Synonym: **RIGHT**.

       **ENDCODE _**color-sequence_
              Specifies the _end_ _code_ for non-ISO/IEC 6429 terminals (see below).

              Synonym: **END**.

       ***_**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 spec‐
              ify an extension not starting with a period, such as **~ **for **emacs **backup  files.   This
              form should be considered obsolete.

### ISO/IEC 6429 (ANSI) color sequences
       Most  color-capable  ASCII  terminals today use ISO/IEC 6429 (ANSI) color sequences, and many
       common terminals without color capability, including **xterm **and the widely used and cloned DEC
       VT100, will recognize ISO/IEC 6429 color codes and harmlessly eliminate them from the  output
       or emulate them.  **ls **uses ISO/IEC 6429 codes by default, assuming colorization is enabled.

       ISO/IEC  6429  color  sequences are composed of sequences of numbers separated by semicolons.
       The most common codes are:
               0   to restore default color
               1   for brighter colors
               4   for underlined text
               5   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.

       **ls **uses the following defaults:
       **NORMAL    **0           Normal (nonfilename) text
       **FILE      **0           Regular file
       **DIR       **32          Directory
       **LINK      **36          Symbolic link
       **ORPHAN    **undefined   Orphaned symbolic link
       **MISSING   **undefined   Missing file
       **FIFO      **31          Named pipe (FIFO)
       **SOCK      **33          Socket
       **BLK       **44;37       Block device
       **CHR       **44;37       Character device
       **EXEC      **35          Executable file

       A few terminal programs do not recognize the default properly.  If all  text  gets  colorized
       after you do a directory listing, change the **NORMAL **and **FILE **codes 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 **ENDCODE **definitions.

       When  writing  out  a filename, **ls **generates the following output sequence: **LEFTCODE _**typecode_
       **RIGHTCODE _**filename_ **ENDCODE**, where the _typecode_ is the color sequence that depends on the type
       or name of file.  If the **ENDCODE **is undefined, the sequence **LEFTCODE NORMAL RIGHTCODE **will be
       used instead.  The purpose of the left- and rightcodes is merely to reduce the amount of typ‐
       ing necessary (and to hide ugly escape codes away from the user).  If they are not  appropri‐
       ate  for your terminal, you can eliminate them by specifying the respective keyword on a line
       by itself.

       **NOTE: **If the **ENDCODE **is defined in the global section of the setup file, it _cannot_  be  unde‐
       fined in a terminal-specific section of the file.  This means any **NORMAL **definition will have
       no effect.  A different **ENDCODE **can, however, be specified, which would have the same effect.

### Escape sequences
       To 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 in‐
       cludes 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)
              **\x_**nnn_   Any character (hexadecimal notation)
              **\_      **Space
              **\\      **Backslash (\)
              **\^      **Caret (^)
              **\#      **Hash mark (#)

       Note that escapes are necessary to enter a space, backslash, caret, or any control  character
       anywhere in the string, as well as a hash mark as the first character.

## FILES
       _/etc/DIR_COLORS_
              System-wide configuration file.  (Slackware, SuSE and RedHat only; ignored by GNU **dir‐**
              [**colors**(1)](https://www.chedong.com/phpMan.php/man/colors/1/markdown) and thus Debian.)

       _~/.dir_colors_
              (Slackware,  SuSE and RedHat only; ignored by GNU [**dircolors**(1)](https://www.chedong.com/phpMan.php/man/dircolors/1/markdown) and thus Debian.)  Per-
              user configuration file.

       This page describes the **dir_colors **file format as used in the  fileutils-4.1  package;  other
       versions may differ slightly.

## NOTES
       The default **LEFTCODE **and **RIGHTCODE **definitions, which are used by ISO/IEC 6429 terminals are:
              **LEFTCODE    **\e[
              **RIGHTCODE   **m

       The default **ENDCODE **is undefined.

## SEE ALSO
       [**dircolors**(1)](https://www.chedong.com/phpMan.php/man/dircolors/1/markdown), [**ls**(1)](https://www.chedong.com/phpMan.php/man/ls/1/markdown), [**stty**(1)](https://www.chedong.com/phpMan.php/man/stty/1/markdown), [**xterm**(1)](https://www.chedong.com/phpMan.php/man/xterm/1/markdown)

Linux man-pages 6.7                          2024-01-28                                [_dir_colors_(5)](https://www.chedong.com/phpMan.php/man/dircolors/5/markdown)
