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
?
colorsconsolels
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
?
Best Answer
To change your directory colors, open up your
~/.bashrc
file with your editorand make the following entry at the end of the file:
Some nice color choices (in this case
0;35
it is purple) are:The first number is the style (1=bold), followed by a semicolon, and then the actual number of the color, possible styles (effects) are:
The possible backgrounds:
All possible colors:
These can even be combined, so that a parameter like:
in your LS_COLORS variable would make directories appear in bold underlined red text with a green background!
To test all these colors and styles in your terminal, you can use one of:
You can also change other kinds of files when using the ls command by defining each kind with:
A more complete list is available at Bigsoft - Configuring LS_COLORS.
On some distributions, you might also want to change the background color for
ow
"(OTHER_WRITABLE
) whose default is non-readable" for example to non-bold blue text on green background.You could use for instance
LS_COLORS="$LS_COLORS:di=1;33"
at the end of your.bashrc
file, to get a nice readable bold orange text on black background.After you alter your .bashrc file, to put the changes in effect you will have to restart your shell or run
source ~/.bashrc
.Note: You can combine more commands with a colon, for example
Source: