ifconfig command not found

  1. 1、查看是否真的没有设置IP地址:

    命令行中输入ip addr,若看到有ip地址,则说明已设置正常,若没有则需要设置一个。

    centOS7下ifconfig提示command not found
  2.  

    2、确认sbin目录是否存在;

    在命令行中输入:cd /sbin

    centOS7下ifconfig提示command not found
  3.  

    3、确认是否安装ifconfig命令:

    在sbin目录中输入ls | grep ‘ifconfig’,没有则说明没有安装。

    centOS7下ifconfig提示command not found
  4.  

    注:此处有,是因为我已经安装了,没有则继续第4步。

  5.  

    4、安装net-tools,因为该包中包含ifconfig命令:

    sudo yum install net-tools

    安装过程中询问是否安装,输入’y’并回车即可。

    centOS7下ifconfig提示command not found
  6.  

    注:因为我已经安装了,所以此处无需做任何改动。

  7.  

    5、再次在命令行中输入ifconfig,查看到ip则安装成功。

原文地址:https://www.cnblogs.com/kate7/p/14520866.html