Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
dir_colors(5)
Edit
PageHistory
Diff
Info
LikePages
DIR_COLORS !!!DIR_COLORS NAME DESCRIPTION ISO 6429 (ANSI) COLOR SEQUENCES OTHER TERMINAL TYPES (ADVANCED CONFIGURATION) ESCAPE SEQUENCES NOTES SEE ALSO FILES NOTES ---- !!NAME dir_colors - configuration file for dircolors(1) !!DESCRIPTION The program ls(1) uses the environment variable __LS_COLORS__ to determine in what color the filenames should 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).) Usually, the file used here is ''/etc/DIR_COLORS'' and can be overridden 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 (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, which are preceded by one or more __TERM__ statements which specify the terminal types (as given by the __TERM__ environment variable) the following declarations apply for. 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 __TERM__ statements can be used to create a section which applies for several terminal types. __COLOR yes|all|no|none|tty__ Specifies that colorization should be always 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__ Specifies that eight-bit ISO 8859 characters should be enabled by default. Can for compatibility reasons also be specified as 1 for ''yes'' or 0 for ''no''. The default is ''no''. __OPTIONS__ ''options'' Adds command line options to the default __ls__ command line. The options can be any valid __ls__ command line options, and should include the leading minus sign. Please note that __dircolors__ does not verify the validity of these options. __NORMAL__ ''color-sequence'' Specifies the color used for normal (non-filename) 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. __ORPHAN__ ''color-sequence'' Specifies the color used for an orphanned symbolic link (one which points to a nonexistent 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). __SOCK__ ''color-sequence'' Specifies the color used for a socket. __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. __LEFTCODE__ ''color-sequence'' Specifies the ''left code'' for non-ISO 6429 terminals (see below). __RIGHTCODE__ ''color-sequence'' Specifies the ''right code'' for non-ISO 6429 terminals (see below). __ENDCODE__ ''color-sequence'' Specifies the ''end code'' for 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 __emacs__ backup files. This form should be considered obsolete. !!ISO 6429 (ANSI) COLOR SEQUENCES Most color-capable ASCII terminals today use ISO 6429 (ANSI) color sequences, and many common terminals without color capability, including __xterm__ and the widely used and cloned DEC VT100, will recognize ISO 6429 color codes and harmlessly eliminate them from the output or emulate them. __ls__ uses 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: 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 (non-filename) text __FILE__ 0 Regular file __DIR__ 32 Directory __LINK__ 36 Symbolic link __ORPHAN__ undefined Orphanned 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 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 __ENDCODE__ is defined in the global section of the setup file, it ''cannot'' be undefined 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 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) __x__''nnn'' Any character (hexadecimal notation) _____ Space __\__ Backslash () __^__ Caret (^) __#__ Hash mark (#) Please 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. !!NOTES The default __LEFTCODE__ and __RIGHTCODE__ definitions, which are used by ISO 6429 terminals are: __LEFTCODE__ e[[ __RIGHTCODE__ m The default __ENDCODE__ is undefined. !!SEE ALSO dircolors(1), ls(1), stty(1), xterm(1) !!FILES ''/etc/DIR_COLORS'' System-wide configuration file for __dircolors__. ''~/.dir_colors'' Per-user configuration file for __dircolors__. !!NOTES This page describes the __dir_colors__ file format as found in the fileutils-4.0 package; other versions may differ slightly. Mail corrections and additions to aeb@cwi.nl. Report bugs in the program to fileutils-bugs@gnu.ai.mit.edu. ----
One page links to
dir_colors(5)
:
Man5d
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.