9

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.

the
  • 468
  • 8
  • 23
pondermatic
  • 227
  • 2
  • 6

3 Answers3

10

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.

theotherreceive
  • 8,235
  • 1
  • 30
  • 44
0

Might be a broken alias. Try /bin/ls

jlliagre
  • 8,691
  • 16
  • 36
0

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.
The Unix Janitor
  • 2,388
  • 14
  • 13