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 (
difor directories,fifor 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)
- Check current settings: Run
dircolors -bin the terminal to see output oreval $(dircolors)to apply defaults. - Copy the default: Copy
/etc/DIR_COLORSto your home directory:cp /etc/DIR_COLORS ~/.dircolors. - Edit your copy: Open
~/.dircolors(e.g., withnano ~/.dircolors) and change color codes (e.g.,OTHER_WRITABLE 01;33for bold yellow). - Apply changes: Add
eval $(dircolors ~/.dircolors)to your~/.bashrcfile to load it on login, as direct/etc/DIR_COLORSedits may not work due to Unraid’s setup.
