关于nginx:如何解决Ubuntu提示没有找到ifconfig命令

1次阅读

共计 1394 个字符,预计需要花费 4 分钟才能阅读完成。

在咱们新装置的 Ubuntu 20.04 操作系统中,咱们想要查看 ip 地址,发现应用 ifconfig 命令,提醒找不到这个命令。在上面文章汇总,会介绍如何装置这个工具。
当在运行 ifconfig 命令是,提醒上面的谬误,就代表没有装置它:

bob@ubuntu-20-04:~$ ifconfig

Command ‘ifconfig’ not found, but can be installed with:

sudo apt install net-tools
或者提醒上面的信息:

-bash: ifconfig: command not found
在 Ubuntu 20.04 中,不倡议应用 ifconfig 命令。这就是为什么会收到无关短少的 ifconfig 命令的谬误的起因。若想要查看 ip 地址。能够应用 ip addr 命令,它简直能够执行与 ifconfig 命令雷同的工作,如上面的代码所示:

bob@ubuntu-20-04:~$ ip addr
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever

2: ens33: mtu 1500 qdisc fq_codel state UP group default qlen 1000

link/ether 00:0c:29:40:d4:6f brd ff:ff:ff:ff:ff:ff
inet 192.168.43.174/24 brd 192.168.43.255 scope global dynamic noprefixroute ens33
   valid_lft 1337sec preferred_lft 1337sec
inet6 fe80::7559:c488:6787:289d/64 scope link noprefixroute 
   valid_lft forever preferred_lft forever

如何解决 Ubuntu 提醒没有找到 ifconfig 命令如何解决 Ubuntu 提醒没有找到 ifconfig 命令
从下面代码输入中能够看到,该命令仍将显示所有网络接口的 IP 地址和其余统计信息。

如果习惯应用旧的 ifconfig 命令,则须要装置 net-tools 软件包。net-tools 是一个工具包,其中蕴含形成 Linux 网络根底的一系列程序。这些包含:

ifconfig
netstat
dig
hostname
route
arp
iptunnel
解决 ifconfig 命令找不到的问题
要解决以上谬误,就须要装置 net-tools 工具包:

bob@ubuntu-20-04:~$ sudo apt install net-tools
如何解决 Ubuntu 提醒没有找到 ifconfig 命令如何解决 Ubuntu 提醒没有找到 ifconfig 命令
装置胜利实现后,再次尝试运行 ifconfig 命令,能够看到相熟的脸孔了。

总结
ifconfig 曾经逐步被 ip addr 取代了,因为当初大部分发行版本,比方 Centos\RHEL、Fedora、Ubuntu 等零碎都勾销了 net-tools 工具包了。

正文完
 0