查看本机上的端口使用情况netstat -an「建议收藏」

查看本机上的端口使用情况netstat -an「建议收藏」1.查找本机上的端口使用情况netstat-an2.查找指定端口的使用情况C:\Windows\System32>netstat-ano|find"8002"

大家好,又见面了,我是你们的朋友全栈君。

1.查找本机上的端口使用情况

netstat -an

查看本机上的端口使用情况netstat -an「建议收藏」

 

 

2.查找指定端口的使用情况

C:\Windows\System32>netstat -ano | find “8002”
TCP 0.0.0.0:8002 0.0.0.0:0 LISTENING 2884
TCP [::]:8002 [::]:0 LISTENING 2884

参数说明:

-a 列出所有的

-n 数字的形式列出

-o 显示进程编号

输出结果:

第一列是协议类型,第二列是local address,第三列是remote address,第四列是状态,最后一列是进程编号

 

2.1找到占用端口的应用程序

查找结果的最后一列是进程编号,可以在任务管理器里找到对应的进程

C:\Windows\System32\inetsrv>netstat -ano | find “8080”
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 2564
TCP 172.31.212.108:54133 172.16.210.31:8080 ESTABLISHED 6804
TCP 172.31.212.108:60264 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60266 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60267 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60268 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60304 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60307 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60320 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60324 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60333 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60337 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60341 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60342 172.16.210.31:8080 ESTABLISHED 11820
TCP 172.31.212.108:60344 172.16.210.31:8080 ESTABLISHED 11820
TCP 172.31.212.108:60345 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60346 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60347 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60349 172.16.210.31:8080 TIME_WAIT 0
TCP 172.31.212.108:60354 172.16.210.31:8080 CLOSE_WAIT 17116
TCP 172.31.212.108:60355 172.16.210.31:8080 CLOSE_WAIT 17116
TCP 172.31.212.108:60356 172.16.210.31:8080 ESTABLISHED 7540
TCP 172.31.212.108:60358 172.16.210.31:8080 ESTABLISHED 7540
TCP 172.31.212.108:60365 172.16.210.31:8080 ESTABLISHED 6804
TCP 172.31.212.108:60369 172.16.210.31:8080 FIN_WAIT_2 6804
TCP 172.31.212.108:60390 172.30.115.41:8080 TIME_WAIT 0
TCP 172.31.212.108:60392 172.30.115.41:8080 TIME_WAIT 0
TCP 172.31.212.108:60400 172.16.210.31:8080 FIN_WAIT_2 6804
TCP 172.31.212.108:60405 172.16.210.31:8080 FIN_WAIT_2 6804
TCP 172.31.212.108:60406 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60422 172.16.210.31:8080 FIN_WAIT_2 6804
TCP 172.31.212.108:60447 172.30.115.41:8080 TIME_WAIT 0
TCP 172.31.212.108:60459 172.30.115.41:8080 TIME_WAIT 0
TCP 172.31.212.108:60460 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60469 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60474 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60481 172.30.115.41:8080 TIME_WAIT 0
TCP 172.31.212.108:60484 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60485 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60486 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60487 172.30.115.41:8080 TIME_WAIT 0
TCP 172.31.212.108:60488 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60490 172.30.115.41:8080 TIME_WAIT 0
TCP 172.31.212.108:60492 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60495 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60497 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60499 172.30.115.41:8080 ESTABLISHED 11876
TCP 172.31.212.108:60501 172.30.115.41:8080 TIME_WAIT 0
TCP 172.31.212.108:60504 172.30.115.41:8080 TIME_WAIT 0
TCP 172.31.212.108:60514 172.16.210.31:8080 ESTABLISHED 6804
TCP 172.31.212.108:60515 172.16.210.31:8080 ESTABLISHED 6804
TCP 172.31.212.108:60516 172.16.210.31:8080 ESTABLISHED 6804
TCP 172.31.212.108:60517 172.16.210.31:8080 ESTABLISHED 6804
TCP 172.31.212.108:60518 172.16.210.31:8080 ESTABLISHED 6804
TCP 172.31.212.108:60519 172.16.210.31:8080 ESTABLISHED 6804
TCP [::]:8080 [::]:0 LISTENING 2564
TCP [::1]:8080 [::1]:60363 TIME_WAIT 0
TCP [::1]:8080 [::1]:60366 TIME_WAIT 0
TCP [::1]:8080 [::1]:60367 TIME_WAIT 0
TCP [::1]:8080 [::1]:60424 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60425 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60426 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60427 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60428 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60429 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60508 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60509 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60510 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60511 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60512 ESTABLISHED 2564
TCP [::1]:8080 [::1]:60513 ESTABLISHED 2564
TCP [::1]:60364 [::1]:8080 TIME_WAIT 0
TCP [::1]:60424 [::1]:8080 ESTABLISHED 11876
TCP [::1]:60425 [::1]:8080 ESTABLISHED 11876
TCP [::1]:60426 [::1]:8080 ESTABLISHED 11876
TCP [::1]:60427 [::1]:8080 ESTABLISHED 11876
TCP [::1]:60428 [::1]:8080 ESTABLISHED 11876
TCP [::1]:60429 [::1]:8080 ESTABLISHED 11876
TCP [::1]:60508 [::1]:8080 ESTABLISHED 6804
TCP [::1]:60509 [::1]:8080 ESTABLISHED 6804
TCP [::1]:60510 [::1]:8080 ESTABLISHED 6804
TCP [::1]:60511 [::1]:8080 ESTABLISHED 6804
TCP [::1]:60512 [::1]:8080 ESTABLISHED 6804
TCP [::1]:60513 [::1]:8080 ESTABLISHED 6804

 

https://serverfault.com/questions/342481/understanding-the-netstat-command-output

from netstat -h:

-a            Displays all connections and listening ports.

As in both current connections and listening ports (half open).

-n            Displays addresses and port numbers in numerical form.

As in, do not resolve addresses to host names.

Your computer can and regularly does connect to itself, usually for IPC or administrative tasks.

*.* = All IPv4 addresses (it’s listening, so accept connections from any IPv4)
[::] = All IPv6 addresses (same reason as the last).

 

3.使用图形界面查看

查看本机上的端口使用情况netstat -an「建议收藏」

 

查看本机上的端口使用情况netstat -an「建议收藏」

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/155392.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • pycharm jinja2_Python django

    pycharm jinja2_Python djangojinja2语法基本语法在jinja2中,存在三种语法:控制结构{%%}变量取值{{}}注释{##}下面是一个简单的jinja2例子{#Thisisjinjacode{%forfileinfilenames%}…{%endfor%}#}可以看到,for循环的使用方式和Python比较类似,但是没有了句尾的冒号,另外需要使用endfor最为结尾,其实在jinja2…

    2022年10月23日
  • shuffer_shuforall

    shuffer_shuforall论文:ShuffleNet:AnExtremelyEfficientConvolutionalNeuralNetworkforMobileDevices论文提到模型加速的方法为:1) 修剪网络,减少分支(pruningnetworkconnections)。2) 对于一个训练好的网络(pre-trainedmodel),在性能不下降的情况下减少冗余的分支。3) 量化(qua…

    2022年10月27日
  • allow_url_fopen设置

    allow_url_fopen设置使用file,fopen或file_get_contents函数打开远程url时,需要PHP配置中(php.ini)将allow_url_fopen的值设置为On。按照默认设置,这个值本身就是On的。如果allow_url_fopen已经为on,但file,fopen,file_get_contents依然报错,就是服务器的DNS问题,造成了路由结果中有部份路由执行超时,最终PHP执行…

  • CoreOS裸机iso安装和相关配置

    CoreOS裸机iso安装和相关配置

  • laravel 获取目录下的所有目录Storage::directories

    laravel 获取目录下的所有目录Storage::directories

  • thinkpad笔记本电脑指示灯图解_thinkpad笔记本关机后,指示灯还亮

    thinkpad笔记本电脑指示灯图解_thinkpad笔记本关机后,指示灯还亮顺序自左向右: 1挂起状态指示灯绿色:计算机处于挂起状态绿色且不断闪烁:计算机正在进入挂起或休眠状态,或者正在从挂起或休眠状态中恢复回来2AC电源状态指示灯绿色:计算机连接到交流电源上3电池状态指示灯绿色:电池电量在80%到100%of之间,以及电量处于20%到80%之间,正在使用中.绿色且不断闪烁:电池电量在20%到80%之间,且正在充电中.橙色:电池电量

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号