How to Change Font Colors in CentOS / RedHat

Red & Turquoise Terminal

Red & Turquoise Terminal

One of my monitor display was bothering my eyes, therefore I decided to change the colors being displayed on the monitor I am using, especially for the directory as it was dark blue and I had to dig myself inside the screen to actually read in that color. (my eyes are not week but I love small fonts)

I was not sure how to do it but knew it can be changed as I studied them long time ago, did some research and found out there are multiple ways to perform it.

As my environment is an Ansible lab therefore it did not click me to just change it for a specific user therefore I changed in environment base:

This is what I did: (from root user)

vim /etc/DIR_COLORS
DIR 01;96

Just above DIR value, I found out FILE parameter but it was commented, so i edited it to

vim /etc/DIR_COLORS
FILE 01;91

Now my terminal is displaying 96  = turquoise as DIR and 91  = light red as FILE and I like it !!

For you reference color codes:

0 = default colour
1 = bold
4 = underlined
5 = flashing text
7 = reverse field
31 = red
32 = green
33 = orange
34 = blue
35 = purple
36 = cyan
37 = grey
40 = black background
41 = red background
42 = green background
43 = orange background
44 = blue background
45 = purple background
46 = cyan background
47 = grey background
90 = dark grey
91 = light red
92 = light green
93 = yellow
94 = light blue
95 = light purple
96 = turquoise
100 = dark grey background
101 = light red background
102 = light green background
103 = yellow background
104 = light blue background
105 = light purple background
106 = turquoise background

I did not try it but if you are interested in changing it for specific user you can try this:

cp /etc/DIR_COLORS to $HOME/.dir_colors

once copied, edit you local copy i.e .dir_colors and play with it.

Don’t forget you need to re-initialize the shell or logout and login back for changes to take affect.