3

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.

JP Silvashy
  • 1,447
  • 6
  • 24
  • 30

2 Answers2

10

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.

EDIT :

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

Studer
  • 1,350
  • 9
  • 16
0

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

theotherreceive
  • 8,365
  • 1
  • 31
  • 44