记在centos7中遇到的“ifconfig: 未找到命令”的问

2018-08-15  本文已影响0人  兔子Tony的主人

遇到这个问题的一些情况记录

解决这个问题的过程

首先查看ifconfig 命令在哪个目录下,顺便检查是否安装了这个命令
whereis ifconfig
然后查看PATH中是否包含了这个目录,一般情况下是不包含的,只要添加进去就OK了
echo $PATH
添加路径,我的路径添加时以下代码,之后就可以正常使用了。
export PATH=$PATH:/sbin
# yum search ifconfig
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.confluxtech.com
 * epel: mirrors.kernel.org
 * extras: mirror.confluxtech.com
 * updates: mirror.confluxtech.com
===================== 匹配:ifconfig ================================
net-tools.x86_64 : Basic networking tools
python-psutil.x86_64 : A process and system utilities module for Python

需要安装这个包 net-tools.x86_64

然后运行安装net-tools的命令
# yum install -y net-tools

我自己操作的截图入下


yum查看ifconfig,并安装net-tools

然后用whereis命令查看ifconfig是的效果如截图所示


安装net-tools后,使用ifconfig和用whereis命令查看ifconfig的效果
至此,该问题顺利解决。
上一篇 下一篇

猜你喜欢

热点阅读