netstat 命令在大多数 Linux 发行版中都可用,但具体版本和可用选项可能因发行版而异
例如,在基于 Debian 的系统(如 Ubuntu)中,可以使用以下命令安装 net-tools 包(其中包含 netstat):
sudo apt-get update sudo apt-get install net-tools 在基于 RHEL 的系统(如 CentOS 和 Fedora)中,可以使用以下命令安装 net-tools 包:
sudo yum install net-tools 或者
sudo dnf install net-tools 请注意,某些 Linux 发行版可能已经弃用了 netstat,并推荐使用其他工具,如 ss。在这些发行版中,您可能需要安装 iproute2 软件包以获得类似的功能。