当前位置: 首页 > news >正文

Windows查看端口占用情况

Windows如何查看端口占用情况
方法1. cmd命令行执行netstat命令,查看端口占用情况
netstat -ano

以上命令输出太多信息,不方便查看,通过如下命令搜索具体端口占用情况,例如:8080端口

netstat -ano | findstr "8080"

方法2. 打开资源监视器

按下Win + R键,输入resmon ,回车,打开资源监视器,点击网络,查看侦听端口

另外:

如果需要终止某个进程,使用taskkill命令,查看命令帮助

C:\Users\Administrator>taskkill /?TASKKILL [/S system [/U username [/P [password]]]]{ [/FI filter] [/PID processid | /IM imagename] } [/T] [/F]Description:This tool is used to terminate tasks by process id (PID) or image name.Parameter List:/S    system           Specifies the remote system to connect to./U    [domain\]user    Specifies the user context under which thecommand should execute./P    [password]       Specifies the password for the given usercontext. Prompts for input if omitted./FI   filter           Applies a filter to select a set of tasks.Allows "*" to be used. ex. imagename eq acme*/PID  processid        Specifies the PID of the process to be terminated.Use TaskList to get the PID./IM   imagename        Specifies the image name of the processto be terminated. Wildcard '*' can be usedto specify all tasks or image names./T                     Terminates the specified process and anychild processes which were started by it./F                     Specifies to forcefully terminate the process(es)./?                     Displays this help message.Filters:Filter Name   Valid Operators           Valid Value(s)-----------   ---------------           -------------------------STATUS        eq, ne                    RUNNING |NOT RESPONDING | UNKNOWNIMAGENAME     eq, ne                    Image namePID           eq, ne, gt, lt, ge, le    PID valueSESSION       eq, ne, gt, lt, ge, le    Session number.CPUTIME       eq, ne, gt, lt, ge, le    CPU time in the formatof hh:mm:ss.hh - hours,mm - minutes, ss - secondsMEMUSAGE      eq, ne, gt, lt, ge, le    Memory usage in KBUSERNAME      eq, ne                    User name in [domain\]userformatMODULES       eq, ne                    DLL nameSERVICES      eq, ne                    Service nameWINDOWTITLE   eq, ne                    Window titleNOTE----1) Wildcard '*' for /IM switch is accepted only when a filter is applied.2) Termination of remote processes will always be done forcefully (/F).3) "WINDOWTITLE" and "STATUS" filters are not considered when a remotemachine is specified.Examples:TASKKILL /IM notepad.exeTASKKILL /PID 1230 /PID 1241 /PID 1253 /TTASKKILL /F /IM cmd.exe /TTASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exeTASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"

例如,终止占用8080端口的7216进程,命令如下:

taskkill /f /t /pid 7216

参数含义: 

    /f:强制终止进程

     /t:终止所有子进程

    /pid:根据进程id终止进程

终止使用8080端口的进程
C:\Users\Administrator>taskkill /f /t /pid 7216
SUCCESS: The process with PID 7216 (child process of PID 11896) has been terminated.再次查看8080端口的占用情况
C:\Users\Administrator>netstat -ano | findstr "8080"C:\Users\Administrator>

完成!enjoy it!

http://www.lryc.cn/news/226309.html

相关文章:

  • Python:词法分析(行结构与显式、隐式行拼接)
  • 前端Vue 结合xlxs库实现解析excel文件,并动态组装表头!
  • RabbitMQ集群配置以及负载均衡配置
  • Leetcode Hot100之六:42.接雨水
  • electron 主进程 和 渲染进程通信 ipcRenderer 和 mainWindow.webContents
  • 关于VUE启动内存溢出
  • HBase学习笔记(1)—— 知识点总结
  • 【Linux】 awk命令使用
  • Sentinel网关限流
  • solidworks对电脑要求高吗?2023solidworks配置要求
  • 搭建神经网络(torch.nn的用法)
  • 卡码网语言基础课 | 11. 句子缩写
  • Surface RT 安装 Linux
  • C++中的函数重载:多功能而强大的特性
  • 数据分析实战 | K-means算法——蛋白质消费特征分析
  • HTTP协议详解-下(Tomcat)
  • acwing算法基础之搜索与图论--prim算法
  • Amazon EC2 Serial Console 现已在其他亚马逊云科技区域推出
  • hdlbits系列verilog解答(100输入逻辑门)-39
  • Python 中 Selenium 的屏幕截图
  • scrapy发json的post请求
  • 一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
  • 自主开发刷题应用网站H5源码(无需后端无需数据库)
  • java 读取excel/word存入mysql
  • 11.(vue3.x+vite)组件间通信方式之ref与$parent、$children
  • [工业自动化-12]:西门子S7-15xxx编程 - PLC从站 - ET200 SP系列详解
  • 消息队列简介
  • SQL中实现汉字的拼音首字母查询
  • 今天知道LiveData的ktx是真的香
  • SpringBoot中的桥接模式