Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 recently installed zsh and now whenever I ls or ls -l or ls anything I get "illegal option". Not sure where to start looking to fix this.

share|improve this question
up vote 8 down vote accepted

Run which ls to see what exactly is ran why you type ls. ls may be configured as an alias with options not available on your system.

share|improve this answer
Yup, it was configured with --color=auto. Replaced with -G and it works. Thanks. – bingle Mar 21 '10 at 2:51

Might be a broken alias. Try /bin/ls

share|improve this answer


if you even find yourself without /bin/ls , (recovery limited shell / corruption / meltdown) then you can use

echo *

which will display file and directories in the current directory (it's not pretty, but it works!)

as echo is a shell built in, it will always work, without the help of external unix tools :-)


type echo

echo is a shell builtin

here a short list of the bash built-in's (I don't have zsh installed)

bash defines the following built-in commands: :, ., [, alias, bg, bind,
   break,  builtin,  case,  cd,  command,  compgen,  complete,   continue,
   declare,  dirs, disown, echo, enable, eval, exec, exit, export, fc, fg,
   getopts, hash, help, history, if, jobs, kill, let, local, logout, popd,
   printf,  pushd, pwd, read, readonly, return, set, shift, shopt, source,
   suspend, test, times, trap,  type,  typeset,  ulimit,  umask,  unalias,
   unset, until, wait, while.
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.