我注意到在 Ubuntu 上,如果我输入以下内容:
mc
Run Code Online (Sandbox Code Playgroud)
它没有安装,我收到以下消息:
The program 'mc' is currently not installed. You can install it by typing: sudo apt-get install mc
Run Code Online (Sandbox Code Playgroud)
但是在 Debian 中,这是不可用的。它只是给出了“-bash:/usr/bin/mc:没有这样的文件或目录”消息。如何在 Debian 的 bash 命令行中实现相同的功能?是的,我知道如果我想要包建议,我可以简单地使用apt-cache search进行正则表达式搜索。但是,我希望在输入程序名称时立即得到更简单的建议。
根据讨论,该功能由包command-not-found 提供。但是,即使在安装它并安装 bash-completion 包之后,这在 Debian bash shell 上也不可用。
在运行 Ubuntu 时,尝试在 bash 中执行命令时,它曾经提示该程序丢失但在另一个包 Y 中找到,我可以尝试安装它。
现在在 Debian 系统上,情况不再如此。如果未找到该命令,则不会提示任何内容,但会更新包管理器列表。我怎样才能让它从 bash 中给出的命令中建议一个包?
我在运行 find 时遇到错误,如下所示:
find /var/www/virtual/gm.com/episodes/htdocs/downloaded/ -type f -iname '*flash*' -exec ln -sf {} /var/www/virtual/gm.com/234/htdocs/
Run Code Online (Sandbox Code Playgroud)
发现:缺少`-exec'的参数。尝试“查找 --help”以获取更多信息。
怎么了?