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

LS_COLORS='di=1:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rpm=90'
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 from Perth, Australia, but chooses to live, work and play with his amazing wife and two children in Denver, Colorado. He co-founded and co-leads 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.