ls给我“非法选项”

我最近安装了zsh ,现在每当我lsls -lls anything我都会得到“非法选项”。 不知道从哪里开始寻找解决这个问题。

运行which ls来查看究竟是什么运行你为什么键入ls。 ls可能被configuration为别名,而您的系统上没有可用的选项。

可能是一个破碎的别名。 试试/ bin / ls

小费:

如果你甚至发现自己没有/ bin / ls,(恢复限制shell /腐败/崩溃),那么你可以使用

 echo * 

这将显示当前目录中的文件和目录(这不是很漂亮,但它的工作原理!)

因为echo是一个内置的shell,所以它会一直工作,没有外部unix工具的帮助:-)

尝试

 type echo 

echo是一个shell内build的

这里是一个bash内置的简短列表(我没有安装zsh)

 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.