当我通过 ssh 或从控制台登录时,我看到的是:
Linux sensu.lbox.com 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Sep 27 12:40:33 2013
-bash: id: command not found
-bash: [: : integer expression expected
root@sensu:~#
这是什么以及如何摆脱它?
-bash: id: command not found
-bash: [: : integer expression expected
我无法执行大多数命令,它说command not found instead
谢谢。
答案1
它最终是由错误的 /etc/environment 文件引起的。
答案2
是所有用户都会出现这种情况还是只有 root 用户会出现这种情况?如果是每个人,请尝试在 /etc/profile.d 下查找最近修改的脚本(因为问题开始发生)。您可以find /etc/ -path *profile* -mtime -5
查找最近 5 天内修改的内容。如果它只是针对 root,请尝试首先查看 /root/.bashrc 是否有一些错误的脚本。