centos7 (ifconfig不能使用) -bash: ifconfig: command not found

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

输入ip addr 确认IP地址是否设置正常,设置好如下所示,如果没有获取到IP地址则设置一个即可。

确认ifconfig命令是否未安装 

ls /sbin|grep ifconfig

 安装net-tool插件,此插件中带有此命令

sudo yum install net-tools

等待安装完成,再次输入ifconfig,成功。 

 

原文地址:https://www.cnblogs.com/sea-stream/p/10389562.html