本文主要向大家介绍了Linux运维知识之linux -bash: ipconfig: command not found 解决方法,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。
问题: 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频道!