码迷,mamicode.com
首页 > 系统相关 > 详细

linux -bash: ipconfig: command not found 解决方法

时间:2018-05-31 22:01:35      阅读:1074      评论:0      收藏:0      [点我收藏+]

标签:-bash   解决   localhost   path   cal   lin   ros   unset   net   

问题: ipconfig: command not found

[root@localhost root]# ipconfig
-bash: ipconfig: command not found

方法:

1、安装好CentOS5.5后,ipconfig找不到那说明没有将ipconfig命令配置到环境变量。 

2、测试下结果echo $PATH,果然/sbin这个主要目录不在PATH。 

 

[root@localhost network-scripts]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/ #无/sbin命令路径

 


3、使用管理员权限 运行vi /etc/profile 在文件末加入以下语句 :
   PATH=$PATH:/sbin 
   export PATH=$PATH:/sbin
  使用:wq!保存并退出。 

 

[root@localhost boot]# vim /etc/profile
。
。
。
。
unset i
unset pathmunge
PATH=$PATH:/sbin
export PATH=$PATH:/sbin
"/etc/profile" 60L, 1071C  

[root@localhost boot]#:wq

 


4、输入命令:source /etc/profile,让配置信息立即起效 
    再输入ifconfig时就可以使用此命令了。

linux -bash: ipconfig: command not found 解决方法

标签:-bash   解决   localhost   path   cal   lin   ros   unset   net   

原文地址:https://www.cnblogs.com/bin-WSJ/p/9119010.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!