Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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. Thanks.

share|improve this question
add comment

3 Answers

up vote 4 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
add comment

Might be a broken alias. Try /bin/ls

share|improve this answer
add comment

tip:

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 :-)

try

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
add comment

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.