- trixie 2.41-5
- testing 2.41.3-4
- unstable 2.42-1
- experimental 2.42~rc2-1
| TERMINAL-COLORS.D(5) | Dateiformate | TERMINAL-COLORS.D(5) |
BEZEICHNUNG¶
terminal-colors.d - farbliche Darstellung der Ausgabe für verschiedene Dienstprogramme einrichten
ÜBERSICHT¶
/etc/terminal-colors.d/[[Name][@Terminal].][Typ]
BESCHREIBUNG¶
Die Dateien in diesem Verzeichnis bestimmen das Standardverhalten von Dienstprogrammen, wenn deren Ausgabe farbig dargestellt wird.
Der Name ist der Name eines Dienstprogramms. Dieser Name ist optional; wenn keiner angegeben ist, dann wird diese Datei für alle nicht explizit angegebenen Dienstprogramme verwendet.
Terminal ist ein Terminalbezeichner (die Umgebungsvariable TERM). Der Terminalbezeichner ist optional; wenn nichts angegeben ist, wird die Datei auf alle ansonsten nicht spezifizierten Terminals angewendet.
Der Typ ist ein Dateityp. Folgende Typen werden unterstützt:
disable
enable
scheme
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").
Die benutzerspezifischen Dateien $XDG_CONFIG_HOME/terminal−colors.d oder $HOME/.config/terminal−colors.d setzen die globale Einstellung außer Kraft.
VORGEGEBENES FORMAT FÜR SCHEMA-DATEIEN¶
Die folgende Anweisung wird verarbeitet:
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 is a color name, ASCII color sequences, or escape sequences.
Farbbezeichnungen¶
black, blink, blue, bold, brown, cyan, darkgray, gray, green, halfbright, lightblue, lightcyan, lightgray, lightgreen, lightmagenta, lightred, magenta, red, reset, reverse und yellow.
ANSI-Farbsequenzen¶
Die Farbsequenzen werden aus Zahlenfolgen gebildet, die durch Semikola getrennt sind. Die am häufigsten verwendeten Codes sind:
| 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 |
Um beispielsweise einen roten Hintergrund für Warnmeldungen in der Ausgabe von dmesg(1) anzeigen zu lassen, verwenden Sie:
echo 'alert 37;41' >> /etc/terminal-colors.d/dmesg.scheme
Escape-Sequenzen¶
An escape sequence is necessary 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:
| \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) |
| \_ | Space |
| \\ | Backslash (\) |
| \^ | Caret (^) |
| \\# | Hash mark (#) |
Kommentare¶
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 comment.
UMGEBUNGSVARIABLEN¶
TERMINAL_COLORS_DEBUG=all
NO_COLOR
DATEIEN¶
$XDG_CONFIG_HOME/terminal-colors.d
$HOME/.config/terminal-colors.d
/etc/terminal-colors.d
BEISPIEL¶
Farbige Ausgabe für alle kompatiblen Dienstprogramme deaktivieren:
touch /etc/terminal-colors.d/disable
Farbige Ausgabe für alle kompatiblen Dienstprogramme in einem VT100-Terminal deaktivieren:
touch /etc/terminal-colors.d/@vt100.disable
Farbige Ausgabe für alle kompatiblen Dienstprogramme außer dmesg(1) deaktivieren:
touch /etc/terminal-colors.d/disable
touch /etc/terminal-colors.d/dmesg.enable
KOMPATIBILITÄT¶
Die Funktionalität von terminal-colors.d wird derzeit von allen Dienstprogrammen aus util-linux unterstützt, die ihre Ausgaben farbig darstellen können. Weitere Informationen finden Sie im Abschnitt FARBEN der Handbuchseite des jeweiligen Programms.
FEHLER MELDEN¶
Nutzen Sie zum Melden von Fehlern das Fehlererfassungssystem <https://github.com/util-linux/util-linux/issues>.
VERFÜGBARKEIT¶
terminal-colors.d ist Teil des Pakets util-linux, welches aus dem Linux-Kernel-Archiv <https://www.kernel.org/pub/linux/utils/util-linux/> heruntergeladen werden kann.
| 2026-03-26 | util-linux 2.42-rc2 |