Centos 5 无法使用ifconfig命令

问题原因,在环境变量里没有包含文件夹 / sbin , 该文件夹下存有 ifconfig, 可以在终端下 cat /etc/profile, 可以发现没有关于 / sbin 的环境变量

解决方法:
vi /etc/profile
在文件末尾追加下面2行配置文件:
PATH=$PATH:/sbin 
export PATH=$PATH:/sbin

保存文件并退出
运行source /etc/profile
重新输入:ifconfig,测试能否正常运行

原文地址:https://www.cnblogs.com/Mrhuangrui/p/4664325.html