A better shell existence – Changing ls colors

A better shell existence – Changing ls colors

I wasnt satisfied with the default blue color shades for ls, and was exploring ways to change them. I happened to come across the dircolor resources.

To get the default ouput, do this:

dircolors -p > ~/.dircolorsrc

Once this is done, you get a modifiable file with colors for everything. Edit it to your whim.

Then to make sure that the codes get loaded, add the following to your ~/.bashrc:

test -r $d && eval "$(dircolors $d)"

More info can be found by:

info coreutils 'dircolors invocation'



I finally decided on the following colors:


I am attaching my .dircolor file.

Download “Roms” – Downloaded 0 times –

I chose

Dir-Orange Underline




Color chart:

# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37-39=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.