Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a host for my VM, when it had a fresh install of Ubuntu the bash shell had colored directories and files.

How do I duplicate this with ZSH, i've customized my PS1 but I want to customize the color of directories as well... how do I do this?

share|improve this question
up vote 7 down vote accepted

It isn't your shell that determines whether output of ls is colorized. You must run ls --color=auto (either as an alias, or explicitly) in order to get colorised ls output. I suspect that your bash configuration included that alisa by default, but zsh doesn't for some reason. Seems odd that Ubuntu would have crippled their zsh installation in such a fashion, but I've given up trying to work out what they're up to.

share|improve this answer
You can put the alias in your ~/.zshrc file: alias ls='ls --color=auto' – Dennis Williamson Jan 7 '10 at 7:25
I assume your answer is correct for Ubuntu, but since I landed on this question via a Google search and I'm using OSX: the exact flag may vary. For me, it was ls -G. Try man ls then search with /color to find what it is for any given OS. – Nathan Long Oct 7 '11 at 19:58

Your Answer


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.