简体   繁体   English

Linux命令不起作用

[英]Linux command not working

Why is this for ((;;)); do sl; done; 为什么要这样for ((;;)); do sl; done; for ((;;)); do sl; done; not working? 不工作吗? I try to list all files in Ubuntu? 我尝试列出Ubuntu中的所有文件?

Because: 因为:

  1. The command is ls not sl (ie LiSt) 该命令是ls not sl (即LiSt)
  2. You have an infinite loop, but no requirement for one (in your question) so you really only need. 您有一个无限循环,但是(在您的问题中)不需要一个循环,因此您实际上只需要一个循环。

This: 这个:

ls

If you want to run the command over and over to look for changes, you would be better off with: 如果要一遍又一遍地运行命令以查找更改,最好使用以下命令:

watch ls

You didn't specify an error message, so it's hard to say, but I assume that it's not working because you don't have a program named sl installed in any directories in your $PATH . 您没有指定错误消息,所以很难说,但是我认为它不起作用,因为您没有在$PATH中的任何目录中安装名为sl程序。

Maybe you meant ls instead? 也许您是用ls代替的?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM