默认Ubuntu和CentOS都没有netstat等好用方便的网络工具,需要单独安装。
在Ubuntu中安装netstat等工具:
$ sudo apt install net-tools
net-tools是一个网络工具包,里面包含的工具,除了netstat外,还有arp, ifconfig, netstat, rarp, nameif和route。
最后,我们来看看net-tools这个包的info:
$ apt show net-tools
Package: net-tools
Version: 1.60+git20161116.90da8a0-1ubuntu1
Priority: optional
Section: net
Origin: Ubuntu
Maintainer: Ubuntu Developers
Original-Maintainer: net-tools Team
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 803 kB
Depends: libc6 (>= 2.14), libselinux1 (>= 1.32)
Conflicts: ja-trans (<= 0.8-2)
Replaces: ja-trans (<= 0.8-2), netbase (<< 4.00)
Homepage: http://sourceforge.net/projects/net-tools/
Task: dns-server, cloud-image, server, xubuntu-desktop, ubuntustudio-desktop, ubuntu-mate-core, ubuntu-mate-desktop
Supported: 5y
Download-Size: 194 kB
APT-Manual-Installed: yes
APT-Sources: http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
Description: NET-3 networking toolkit
This package includes the important tools for controlling the network
subsystem of the Linux kernel. This includes arp, ifconfig, netstat,
rarp, nameif and route. Additionally, this package contains utilities
relating to particular network hardware types (plipconfig, slattach,
mii-tool) and advanced aspects of IP configuration (iptunnel, ipmaddr).
.
In the upstream package 'hostname' and friends are included. Those are
not installed by this package, since there is a special "hostname*.deb".
以上就是关于在Ubuntu中安装netstat等网络工具的介绍。