ifconfig:ifconfig: command not found解决方案

树叶云

在普通用户或root用户中输入了ifconfig,这时却报错了提示: ifconfig: command not found,下面为大家讲解一下解决方案。

其他情况下你可能也会使用 ipconfig 命令来配置网络选项,如果是初次安装的系统你可能就会遇到如下问题:

ipconfig: command not found
serverspeeder.sh: line 141: ifconfig: command not found
serverspeeder.sh: line 144: ifconfig: command not found

出现此问题的原因绝大多数情况下可能都是系统没有附带ipconfig,例如你安装的是CentOS最小安装包模式。

因此这个时候只需要我们使用命令安装ipconfig即可,命令如下:

yum install upgrade
yum install net-tools

如果本身已经安装了ipconfig但依然报错那就需要看看环境变量的设置:

#echo $PATH

如果环境变量中没有包含ipconfig命令的路径则需要临时修改环境变量:

$export PATH = $PATH:/sbin

修改完成后测试ipconfig是否可以正常使用,如果可以正常使用则需要永久修改:打开/etc/profile

然后在该文件中填写export PATH=$PATH:/sbin并保存,保存后重启系统即可直接使用ipconfig命令了。

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/222257.html<

(0)
运维的头像运维
上一篇2025-04-15 10:10
下一篇 2025-04-15 10:11

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注