Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

On my console the color for directories is such a blue, that it is hard to read on a dark background.

How can I change the color definitions for ls?


After trying something, I wonder how to just replace the definition in $LS_COLORS?

mabe like this in .bashrc?

$LS_COLORS=$LS_COLORS'di=0;35:'
export $LS_COLORS
share|improve this question
add comment

2 Answers 2

To change your directory colors, open up your ~/.bashrc file with your editor

nano ~/.bashrc

and make the following entry at the end of the file:

LS_COLORS='di=0;35' ; export LS_COLORS

Your possible color choices (in this case 0;35 it is purple) are:

Blue = 34
Green = 32
Light Green = 1;32
Cyan = 36
Red = 31
Purple = 35
Brown = 33
Yellow = 1;33
white = 1;37
Light Grey = 0;37
Black = 30
Dark Grey= 1;30

The first number is how light or dark you want the color to be, followed by a semicolon, and then the actual number of the color.

After you alter your .bashrc file, to put the changes in effect you will have to restart your shell.

source: http://www.geekgumbo.com/2011/11/04/changing-the-directory-color-in-the-bash-shell/

share|improve this answer
    
Drawback, This replaces all color definitions with the default and only defines a color for directories instead –  rubo77 May 15 at 7:47
add comment

LS_COLORS

This is a collection of extension:color mappings, suitable to use as your LS COLORS environment variable.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.