From My Virtual Desktop: Color and Contrast

On this Super Bowl Sunday a Client (you know who you are!) asked me quite a wonderful question:

“I can’t stand the command line color for directories in the console: that blue is so hard to see. Is there a way to change it?”

To the Client (and to all of you), yes – you can change the terminal colors as this is a “Linux thing“. The colors to identify directories, symbolic links and so forth have been around for as long as I can recall, but I understand the need/want to as what looks like this:

Can look/feel like this… especially if being accessed from certain SSH tools or Virtual Consoles:

Immediately, I felt the fibre channel connections in my skull warming up to re-add Mental Storage Repositories I had long since forgotten. After a few seconds, I made a note of it as I wanted to share an aesthetic-based “How To” so you can trick out your XenServer command line experience.

1. The Configuration File

The color definitions for the console are stored in /etc/DIR_COLORS. From the command line execute the following so you can start tweaking text colors to your liking:

cd ~

cp /etc/DIR_COLORS ~/.dir_colors

What we just did was copy the global color definition file to root’s home directory as .dir_colors, or /root/.dir_colors. This will allow global color definitions to remain in-tact as well as keep changes for the root user… specific to the root user.

2. The File Contents

Let us take a look at the file and where you will be looking to make changes: you can edit this file with nano or vi:

nano .dir_colors

or

vi .dir_colors

At the top there is some mumbo-jumbo stuff. What we are looking for (see below) is in the middle of the .dir_colors file: