Shell 命令不起作用:REDHAT

Shell 命令不起作用:REDHAT

我在启动脚本中添加了一些服务,然后重启后,我收到此消息-

24 package(s) needed for security, out of 52 available
Run "sudo yum update" to apply all updates.
-bash: id: command not found
-bash: id: command not found
-bash: id: command not found
-bash: tty: command not found
-bash: mktemp: command not found
-bash: $TMP: ambiguous redirect
-bash: rm: command not found

然后,当我尝试运行大多数基本命令(例如netstat,,, 等)时,我收到如下错误消息psgrepll

-bash: ls: command not found

但某些命令(例如cpchkconfig可以正常工作。我已检查我的 /bin/bash 文件是否存在。可能是什么原因?

但在此之前我做了以下改变

echo "JAVA_HOME=/usr/java/jdk1.6.0_45" >> /etc/profile.d/custpath.sh
echo "export JAVA_HOME" >> /etc/profile.d/custpath.sh
echo 'PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile.d/custpath.sh
echo "export PATH" >> /etc/profile.d/custpath.sh

并将 /etc/environment 文件更改为

export JAVA_HOME=/usr/java/jdk1.6.0_45
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$CLASSPATH:/usr/java/jdk1.6.0_45/jre/lib

相关内容