There are two directories shown by 'ls'. Normally directories anywhere are blue on black background. But the first one is blue on green and impossible to read. Why is this? How to make it blue on black, or at least something light on something dark?
This is on Ubuntu 12.04, using bash in Gnome Terminal. In Konsole, the blue is slightly darker, and possible to read, though could be way better.
Best Answer
Apart from coloring files based on their type (turquoise for audio files, bright red for Archives and compressed files, and purple for images and videos),
ls
also colors files and directories based on their attributes:o+w, +t
).o+w, -t
).Stephano Palazzo over at Ask Ubuntu has made this very instructive picture over the different attribute colors:
As terdon pointed out, the color settings can be modified via
dircolors
. A list of the different coloring settings can be accessed withdircolors --print-database
.Each line of output, such as
BLK 40;33;01
, is of the form:TARGET
indicates the target for the coloring ruleTEXT_STYLE
indicates the text style:00
= none01
= bold04
= underscore05
= blink07
= reverse,08
= concealedFOREGROUND_COLOR
indicates the foreground color:30
= black31
= red32
= green33
= yellow34
= blue,35
= magenta36
= cyan37
= whiteBACKGROUND_COLOR
indicates the background colors:40
= black41
= red42
= green43
= yellow44
= blue,45
= magenta46
= cyan47
= whiteFields may be omitted starting from the right, so for instance
.tar 01;31
means bold and red.XTerm and most other modern terminal emulators support 256 colors.
A XTerm 256-color foreground color code is of the form:
A XTerm 256-color background color code is of the form:
where both
FOREGROUND_COLOR
andBACKGROUND_COLOR
is a number the range 0-255. A full list of color codes for the 16 and 256 color modes are shown in the below screenshot: