每次打开终端时,都会不断收到消息“ 404 ::命令未找到”


9

我只是意识到,404:: command not found每次打开终端时,我都会不断收到消息。我不记得收到此消息之前安装了什么:

在此处输入图片说明

我在bash的任何启动文件中都找不到它:

$ grep 404 -H ~/.bashrc ~/.profile ~/.bash_profile ~/.bash.login \
              ~/.bash_aliases /etc/bash.bashrc /etc/profile  \
             /etc/profile.d/* /etc/environment 2> /dev/null
$

我也跑了PS4='${BASH_SOURCE}:${LINENO} ' bash -lxe,可以在这里找到完整的输出。


哇哦 这里确实发生了一些奇怪的事情。您是否知道可能会导致此变化的内容?您正在编辑任何配置文件或其他内容吗?@muru这是一个奇怪的人。
terdon

3
你有什么/etc/bash_completion.d/docker-compose
derobert

另外,我刚刚意识到您在跑步ps $$后就跑了bash -lxe。您能否打开一个新终端,运行ps $$并仅确认输出包含 bash
terdon

Answers:


20

这部分bash -lxe输出

///usr/share/bash-completion/bash_completion:1981 . /etc/bash_completion.d/docker-compose
////etc/bash_completion.d/docker-compose:1 404: Not Found
////etc/bash.bashrc:57 '[' -x /usr/lib/command-not-found ']'
////etc/bash.bashrc:58 /usr/lib/command-not-found -- 404:
404:: command not found
////etc/bash.bashrc:59 return 127

向我读到您的/etc/bash_completion.d/docker-compose开头是404:。我猜您有时试图从某个地方下载该配置文件,而最终保存了一条HTTP错误消息。

该文件应为纯文本;您可以在其上使用首选的文本编辑器(您应该使用sudo / sudoedit / etc。对其进行修改)。

PS:我建议以后在安装文件之前先检查一下下载的文件-不仅要注意错误消息,还要查看它们的作用(尤其是如果您不完全信任该站点的来源或通过该站点提供服务时,这一点尤其重要HTTP(而不是HTTPS)),以及您的特定设置是否需要任何自定义。


2
非常感谢,我只是看了一下里面/etc/bash_completion.d/docker- compose ,只有一行404 not found。我刚刚将其删除。
Petra Barus
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.