TERMINAL-COLORS.D(5) File formats TERMINAL-COLORS.D(5) NAME terminal-colors.d - configure output colorization for various utilities SYNOPSIS /etc/terminal-colors.d/[name.|[name]@term.]type DESCRIPTION Files in this directory determine the default behavior for utilities when coloring output. The name is a utility name. The name is optional and when none is specified then the file is used for all unspecified utilities. The term is a terminal identifier (the TERM environment variable). The ter- minal identifier is optional and when none is specified then the file is used for all unspecified terminals. The type is a file type. Supported file types are: disable Turns off output colorization for all compatible utilities. See also the NO_COLOR environment variable below. enable Turns on output colorization; any matching disable files are ignored. scheme Specifies colors used for output. The file format may be spe- cific to the utility, the default format is described below. If there are more files that match for a utility, then the file with the more specific filename wins. For example, the filename @xterm.scheme has less priority than dmesg@xterm.scheme. The lowest priority are those files without a utility name and terminal identifier (e.g., "disable"). The user-specific $XDG_CONFIG_HOME/terminal-colors.d or $HOME/.config/ter- minal-colors.d overrides the global setting. DEFAULT SCHEME FILES FORMAT The following statement is recognized: name color-sequence The name is a logical name for the color sequence (for example: error). The names are specific to the utilities. For more details always see the COLORS section in the man page for the utility. The color-sequence can be a color name, an ANSI color sequence, or an es- cape sequence. Color names Valid color names are: black, blink, blue, bold, brown, cyan, darkgray, gray, green, halfbright, lightblue, lightcyan, lightgray, lightgreen, lightmagenta, lightred, magenta, red, reset, reverse, and yellow. ANSI color sequences An ANSI color sequence is composed of sequences of numbers separated by semicolons. The most common codes are: allbox tab(:); lt lt. T{ 0 T}:T{ to restore default color T} T{ 1 T}:T{ for brighter colors T} T{ 4 T}:T{ for underlined text T} T{ 5 T}:T{ for flashing text T} T{ 30 T}:T{ for black foreground T} T{ 31 T}:T{ for red foreground T} T{ 32 T}:T{ for green foreground T} T{ 33 T}:T{ for yellow (or brown) foreground T} T{ 34 T}:T{ for blue foreground T} T{ 35 T}:T{ for purple foreground T} T{ 36 T}:T{ for cyan foreground T} T{ 37 T}:T{ for white (or gray) foreground T} T{ 40 T}:T{ for black background T} T{ 41 T}:T{ for red background T} T{ 42 T}:T{ for green background T} T{ 43 T}:T{ for yellow (or brown) background T} T{ 44 T}:T{ for blue background T} T{ 45 T}:T{ for purple background T} T{ 46 T}:T{ for cyan background T} T{ 47 T}:T{ for white (or gray) background T} For example, to use a red background for alert messages in the output of dmesg(1), use: echo 'alert 37;41' >> /etc/terminal-colors.d/dmesg.scheme Escape sequences An escape sequence is needed to enter a space, backslash, caret, or any control character anywhere in a string, as well as a hash mark as the first character. These C-style backslash-escapes can be used: allbox tab(:); lt lt. T{ \a T}:T{ Bell (ASCII 7) T} T{ \b T}:T{ Backspace (ASCII 8) T} T{ \e T}:T{ Escape (ASCII 27) T} T{ \f T}:T{ Form feed (ASCII 12) T} T{ \n T}:T{ Newline (ASCII 10) T} T{ \r T}:T{ Carriage Return (ASCII 13) T} T{ \t T}:T{ Tab (ASCII 9) T} T{ \v T}:T{ Vertical Tab (ASCII 11) T} T{ \? T}:T{ Delete (ASCII 127) T} T{ \_ T}:T{ Space T} T{ \\ T}:T{ Backslash (\) T} T{ \^ T}:T{ Caret (^) T} T{ \\# T}:T{ Hash mark (#) T} Comments Lines where the first non-blank character is a # (hash) are ignored. Any other use of the hash character is not interpreted as introducing a com- ment. ENVIRONMENT TERMINAL_COLORS_DEBUG=all enables debug output. NO_COLOR if defined, this disables output colorization unless explicitly enabled by a command-line option. See https://no-color.org/ for more details. Supported since util-linux version 2.41. FILES $XDG_CONFIG_HOME/terminal-colors.d $HOME/.config/terminal-colors.d /etc/terminal-colors.d EXAMPLES Disable colors for all compatible utilities: touch /etc/terminal-colors.d/disable Disable colors for all compatible utils on a vt100 terminal: touch /etc/terminal-colors.d/@vt100.disable Disable colors for all compatible utils except dmesg(1): touch /etc/terminal-colors.d/disable touch /etc/terminal-colors.d/dmesg.enable COMPATIBILITY The terminal-colors.d functionality is currently supported by all util-linux utilities which provide colorized output. For more details al- ways see the COLORS section in the man page for the utility. REPORTING BUGS For bug reports, use the issue tracker . AVAILABILITY terminal-colors.d is part of the util-linux package which can be downloaded from Linux Kernel Archive . util-linux 2.42.1 2026-05-18 TERMINAL-COLORS.D(5)