我最近在 CentOS 7 上安装了 Nginx Plus,并想使用 netstat 来检查它是否正在侦听端口 80。
你猜怎么着?运行netstat时出现以下错误。
[root@instance-1 init.d]# netstat -anlp |grep 80
-bash: netstat: command not found
[root@instance-1 init.d]# 已解决:-
使用yum命令安装net-tools
yum install net-tools 原来的:
[root@instance-1 init.d]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.xmission.com
* epel: mirror.hmc.edu
* extras: centos.s.uw.edu
* updates: mirrors.syringanetworks.net
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.22.20131004git.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================================
Installing:
net-tools x86_64 2.0-0.22.20131004git.el7 base 305 k
Transaction Summary
===============================================================================================================================================================
Install 1 Package
Total download size: 305 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.22.20131004git.el7.x86_64.rpm | 305 kB 00:00:04
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : net-tools-2.0-0.22.20131004git.el7.x86_64 1/1
Verifying : net-tools-2.0-0.22.20131004git.el7.x86_64 1/1
Installed:
net-tools.x86_64 0:2.0-0.22.20131004git.el7
Complete!
[root@instance-1 init.d]# 现在您可以使用 netstat。
[root@instance-1 init.d]# netstat -anlp |grep 80
tcp 0 0 0.0.0.0: 80 0.0.0.0:* LISTEN 1818/nginx: master
[root@instance-1 init.d]# 我希望这有助于解决CentOS 7 上的 netstat not found 错误。
《疑难解答:CentOS 7 – netstat 命令未找到》浅显易懂的解释!您必须观看的最佳 2 个视频
How to Use the Netstat Command
かんたんお手軽にトラブルシューティングを自動化する! Cisco DNA Center Machine Reasoning Engine (MRE) の紹介




![2021 年如何设置 Raspberry Pi Web 服务器 [指南]](https://i0.wp.com/pcmanabu.com/wp-content/uploads/2019/10/web-server-02-309x198.png?w=1200&resize=1200,0&ssl=1)

