open core »

Change ls terminal colors in OS X Leopard

If you use the terminal in OS X allot, you have probably noticed that the ls command has no colors. You can activate the colors by adding the following to your ~/.profile:

alias ls='ls -G'

Or you can even choose a better way. Adding the following to your ~/.profile:

export CLICOLOR=1

Now you just need to restart your terminal, and you have a all nice and shiny ls output.

The problem is... if you use a dark background, like any other sane person. The dark blue coloring the directories names is simply impossible to read.

To change that color you just need to add another line in your ~/.profile file:

export LSCOLORS=gxfxcxdxbxegedabagacad

What's with the DNA chain? Well, it's just some crazy way to configure the ls output color. You can find the corresponding color to every character on the ls man pages. Just to keep it simple, that combo turns the directory names to cyan, so that they become readable on top of dark backgrounds.