Changing color of directories list

In addition to changing the layout/color of your terminal, you can also set the colors of directories as displayed within the terminal. This comes in handy when you are SSH’ing into a remote PC and the directories are showing up as dark blue against a black background.

From within a terminal, copy the DIR_COLORS file into your home directory.

cp /etc/DIR_COLORS ~/.dir_colors

ls will automatically look for the .dir_colors within your home directory. Open that up and look for the section that looks like this:

# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
FILE 00         # normal file
DIR 01;36       # directory

Adjust the numbers to the appropriately matching color-codes (as defined just above that section). Now ls should display in the assigned colors.

Leave a Reply

Staypressed theme by Themocracy