Debian安装完net-tools后ifconfig命令还是不能用的解决方案

Debian安装完net-tools后ifconfig命令还是不能用的解决方案
1.安装net-tools
首先安装net-tools

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install net-tools
1
2
3
安装完执行ifconfig命令还是提示命令找不到!


2.使用ip addr命令查看
在Debian 10 (从Debian 9 stretch以后 )中,ifconfig命令已被弃用,这就是为什么你会得到ifconfig命令丢失的错误,解决这个障碍的方法是使用ip addr,它可以与ifconfig命令执行相同的任务!


3.完美使用ifconfig命令
安装完net-tools后,使用whereis ifconfig查看ifconfig的位置

whereis ifconfig
1

接着执行以下命令:

alias ifconfig='/sbin/ifconfig'
1

然后在执行ifconfig就不会提示命令找不到的错误了!!!