Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using 'zsh'. In some directory, when I do 'ls --color=tty'. I see some directories have 'blue text' with 'green background', which makes them hard to read.

Can you please tell me how to configure this?

Thank you.

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Assuming you are using GNU ls, you can specify the colors with the environment variable LS_COLORS (note that this is a GNU ls feature and not specific to zsh).

GNU Coreutils has a program called dircolors to help you convert an easy to edit configuration file into a proper (complicated) LS_COLORS variable. See man dircolors for the command, and man dir_colors for the configuration file syntax.

You can

  1. use dircolors --print-database >! dircolors.default to save the defaults (it contains some explanation text) and then modify it.
  2. Google for fancy pre-configured dircolors files (such as this https://github.com/seebi/dircolors-solarized (I've got no relation to this)).

Once done, you'll need dircolors to turn that into a proper LS_COLORS. Note that dircolors outputs in bash and csh formats, for zsh you should use the bash-formatted output.

PS: Use ls --color=auto instead of ls --color=tty.

share|improve this answer

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.