zhcn 技术 手机 非公開: 故障排除:CentOS 7 – 未找到 netstat 命令

故障排除:CentOS 7 – 未找到 netstat 命令

我最近在 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 命令
故障排除:CentOS 7 – 未找到 netstat 命令

《疑难解答:CentOS 7 – netstat 命令未找到》浅显易懂的解释!您必须观看的最佳 2 个视频

How to Use the Netstat Command
https://www.youtube.com/shorts/4WO5LFVNZrQ
かんたんお手軽にトラブルシューティングを自動化する! Cisco DNA Center Machine Reasoning Engine (MRE) の紹介
https://www.youtube.com/watch?v=SN_xo_MFBZg&pp=ygVg44OI44Op44OW44Or44K344Ol44O8 44OG44Kj44Oz44KwOiBDZW50T1MgNyAtIG5ldHN0YXQg44Kz44Oe44Oz44OJ44GM6KaL44Gk44GL4 4KK 44G-44Gb44KTJmhsPUpB

我最近在 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 命令
故障排除:CentOS 7 – 未找到 netstat 命令

《疑难解答:CentOS 7 – netstat 命令未找到》浅显易懂的解释!您必须观看的最佳 2 个视频

How to Use the Netstat Command
https://www.youtube.com/shorts/4WO5LFVNZrQ
かんたんお手軽にトラブルシューティングを自動化する! Cisco DNA Center Machine Reasoning Engine (MRE) の紹介
https://www.youtube.com/watch?v=SN_xo_MFBZg&pp=ygVg44OI44Op44OW44Or44K344Ol44O8 44OG44Kj44Oz44KwOiBDZW50T1MgNyAtIG5ldHN0YXQg44Kz44Oe44Oz44OJ44GM6KaL44Gk44GL4 4KK 44G-44Gb44KTJmhsPUpB