Saw directory listing coloring at Golden Ruby Users Group this week, and needed to have it!

export LS_COLORS

Customize Your Colors

The values in LSCOLORS are codes corresponding to different colors for different types of files. The letter you use indicates which color to use, and the position in the string indicates what type of file should be that color. Each color comes in pairs – a foreground color and a background color. Here is a list of color values:

  • a = black

  • b = red

  • c = green

  • d = brown

  • e = blue

  • f = magenta

  • g = cyan

  • h = grey

  • A = dark grey

  • B = bold red

  • C = bold green

  • D = yellow

  • E = bold blue

  • F = magenta

  • G = cyan

  • H = white

  • x = default

And here is a list of the positions in LSCOLORS:

  • directory

  • symbolic link

  • socket

  • pipe

  • executable

  • block device

  • character device

  • executable with setuid set

  • executable with setguid set

  • directory writable by others, with sticky bit

  • directory writable by others, without sticky bit

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

About the Author

Paul is the founder and chair for the Explore DDD conference. He co-founded and helps lead DDD Denver. Look for him speaking at local user groups, and at regional and international conferences.

If you are looking for an expert hands-on team coach and design mentor in Domain-Driven Design (DDD), BDD with Cucumber, or lean/agile process Paul is available for consulting and training through his company, Virtual Genius LLC.