Linux 7 提示 -bash: ifconfig: command not found

在 Linux 7 服务器上,如果执行 ifconfig 命令,提示信息如下:

-bash: ifconfig: command not found

说明该包没有安装,不能执行 ifconfig 命令,也可以到目录/sbin下确认下:

ls /sbin/* |grep 'ifconfig'

Linux 7 提示 -bash: ifconfig: command not found

可以尝试下 pifconfig,也是可以看相关信息的。

Linux 7 提示 -bash: ifconfig: command not found

如果就习惯用 ifconfig,则需要通过下面命令安装工具包 net-tools,命令如下:

yum install net-tools

再次查看sbin目录,可以看到已经有ifconfig了,执行命令:

Linux 7 提示 -bash: ifconfig: command not found

 ifconfig

Linux 7 提示 -bash: ifconfig: command not found

可以看到错误已解决。

相关文章: