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

问题: 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时就可以使用此命令了。

猜你喜欢

转载自www.cnblogs.com/bin-WSJ/p/9119010.html