The /etc/DIR_COLORS file in Unraid (and Linux generally) defines colors for ls command output, controlling things like directory colors (e.g., sticky/world-writable) and file types, and is used by the dircolors command to set the $LS_COLORS variable, often customized via .bashrc or .dircolors in user home directories for persistent changes, as direct edits to /etc/DIR_COLORS sometimes don’t take effect. 

What it is

  • A configuration file for the dircolors utility, which generates color codes for the LS_COLORS environment variable.
  • It dictates colors for different file types (di for directories, fi for files) and attributes (like sticky bits, setuid, setgid) in terminal listings. 

Common use case on Unraid

  • Users often edit it to change the default blue-on-green for world-writable directories (STICKY_OTHER_WRITABLE) to something more readable, like bold yellow, as seen in this Unraid forum thread

How to customize (Unraid specific)

  1. Check current settings: Run dircolors -b in the terminal to see output or eval $(dircolors) to apply defaults.
  2. Copy the default: Copy /etc/DIR_COLORS to your home directory: cp /etc/DIR_COLORS ~/.dircolors.
  3. Edit your copy: Open ~/.dircolors (e.g., with nano ~/.dircolors) and change color codes (e.g., OTHER_WRITABLE 01;33 for bold yellow).
  4. Apply changes: Add eval $(dircolors ~/.dircolors) to your ~/.bashrc file to load it on login, as direct /etc/DIR_COLORS edits may not work due to Unraid’s setup. 

Leave a Reply