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

但有些命令,如cp,chkconfig正在工作。我已檢查我的 /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

相關內容