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

For some reason when I execute the following:

ls --color=auto 

Results with:

ls: illegal option -- -
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]

Not sure why this is happening, I'm wondering if anyone else has had the same issue.

share|improve this question
up vote 7 down vote accepted

Depending on the OS, ls doesn't always have the functionalities.

There are two different versions of ls :

  • One from the BSD world (for example Mac OS X version) :

The --color=auto doesn't work, use -G instead.

  • One from the Free Software Foundation (Linux for example) :

You can use the --color=auto and the -G option does not list group.

By the way, this has nothing to do with zsh, except if you assign custom PATH in your .zshrc.


If you want the FSF version of ls, simply download the latest coreutils (8.4 now) and compile them.

This will allow you to use the this version. ls-color

share|improve this answer
Excellent input, I'm using OS X, but I also want to use the same profile in my Ubuntu machine, is that going to far? – JP Silvashy Feb 21 '10 at 2:42
I suppose it really doesn't have much to do with ZSH or OS X for that matter, I just want pretty colored directories and what not. – JP Silvashy Feb 21 '10 at 2:43
Of course you can ! I edited my post to show how to do it. – Studer Feb 21 '10 at 2:54

What kind of system are you using? Solaris/BSD ls don't support --color.

share|improve this answer

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.