我有一个运行Ubuntu18.04的服务器,每当我通过SSH登录时,我都会在MOTD结束时收到以下消息:
Command 'syncthing' is available in '/snap/bin/syncthing'
The command could not be located because '/snap/bin' is not included in the PATH environment variable.
syncthing: command not found我确实在服务器上设置了同步(通过snap安装),但是我使用一个在屏幕会话中启动它的脚本来运行它(据我所知,这个脚本不应该自动运行)。有什么地方可以让我看看它为什么要跑吗?我检查过.bashrc,但里面没有任何条目。任何帮助都是非常感谢的。
编辑:
运行Terdon的注释中的第一个建议没有输出任何内容,第二个命令打印了以下内容:
etc/profile.d/01-locale-fix.sh:syncthing
我打开了那个文件,果然有一行只有syncthing。我把这行评论掉了,登出并返回,问题就消失了。
发布于 2019-09-13 14:15:12
无论何时在shell初始化过程中发生这种奇怪的情况,您的第一步应该是检查shell启动时读取的所有文件。由于各种不同类型的(bash)外壳读取不同的文件,您可以使用这个命令在所有可能的re;syncthing文件中找到字符串D1:
grep syncthing ~/.bashrc ~/.profile ~/.bash_profile ~/bash.login \
~/.bash_aliases /etc/bash.bashrc /etc/profile \
/etc/profile.d/* /etc/environment 2> /dev/null.在您的例子中,冒犯的文件是/etc/profile.d中的一个文件,所以只需删除或注释相关的行,您就可以走了!
https://askubuntu.com/questions/1173459
复制相似问题