2

On Ubuntu 14.04, in bash under gnome terminal, Why are files especially directories colored in different ways?

enter image description here

The green colors hide the text to me (How about to you?). Is it done by terminal or bash? Is it a design for some purpose?

Can we change the color that hide the text?

Stephen Kitt
  • 434,908
Tim
  • 101,790

1 Answers1

2

The colours are set by ls, using the LS_COLORS environment variable. To change the colours, you can use dircolors.

dircolors --print-database

outputs the current source settings, which you can store in a file and adapt; then

dircolors ${file}

will output the processed LS_COLORS value for you using the settings in ${file}.

Strictly speaking ls outputs colour codes, and these are mapped to colours by the terminal; there's a more-or-less standard palette (see Wikipedia for details) but there are slight differences from one terminal to another. So you can change the codes ls outputs using dircolors, and you can often adjust the terminal's palette as well, but that would affect all colour-using programs you'd run in the terminal.

As to the design, I suppose the default colours are those the ls maintainers like...

Stephen Kitt
  • 434,908