command not found怎么办

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/11 21:37:16
command not found怎么办

command not found怎么办
command not found怎么办

command not found怎么办
command not found 解决方法 出错原因:主要是一些用在系统管理上的命令,例如 ifconfig,route 等等,他 们位于/sbin,或/usr/sbin/下.其实这些命令本身就没有任何问题,软件包早已安装完毕,路径设置也没有丝毫问题.而出现 Command not found 的原因在于:在终端使用 su 变成超级用户的时 候没有将 root 的路径(环境)一起切换过来,从而导致身份虽然已经 是 root,但是工作的环境和路径依旧是普通用户的.解决方案:1.最直接的办法是使用 su – 或者加参数 -l ,root 的路径会一起跟着变过来,就可以运用 ifconfig 进行网络配置等操作.2.在 root 用户下按照下面的操作进行修改文件,重新 启动或者注销系统,再输入 ifconfig 就可以直接配 置网络了.操作如下:(我自己没实现) [oracle@rhel4ora10g ]$ su [root@rhel4ora10g oracle]#vi /etc/profile 把下面 if 语句注释掉:#path Manipulation if [`id -u` = 0]; then pathmunge /sbin pathmunge /usr/sbin pathmunge/usr/local/sbin fi 修改为:\x0c#path Manipulation #if [`id -u` = 0]; then pathmunge /sbin pathmunge /usr/sbin pathmunge /usr/local/sbin #fi 3.[root@localhost sbin]$ /sbin/ifconfig 就可以出现使用了 4.[root@localhost sbin]$ export PATH=$PATH:/sbin ,这样设置 后,下次就可以直接访问了,免处第一种的麻烦,如:[root@localhost /]$ ifconfig 5.运行两个命令,输出贴出来 1.2.whereis ifconfig echo $PATH \x0c