centos执行ifconfig的时候报错,找不到ifconfig命令

[vagrant@localhost ~]$ ifconfig
-bash: ifconfig: command not found

找不到ifconfig命令,看了path路径是对的,有/sbin路径,但是/sbin路径下没有/ifconfig,所以就知道该linux系统没有安装ifconfig,安装办法:

1. 输入命令 yum search ifconfig

从上图最后一行可以看到该命令在net-tools.x86_64包中

2.然后输入yum install net-tools.x86_64  后面提示的时候输入几次y就可以了。

或者直接yum install net-tools.x86_64

原文地址:https://www.cnblogs.com/sy_test/p/13586833.html