netstat -ano | findstr xxx

cccs7 Lv5

netstat -ano|findstr

windows 的dos 命令窗口 可以输入 netstat -ano 查看 端口使用情况

image-20230107140555621

如果要查看指定 端口是否被占用,可以使用命令 netstat -ano | findstr xxx

image-20230107140715113


如果结果为空则说明没有被使用,如果有值则说明已经被使用,最后一列为使用 1900 端口号的进程ID。


也可以使用 taskkill /pid xxx /t /f 停止服务

image-20230107141528982

  • Title: netstat -ano | findstr xxx
  • Author: cccs7
  • Created at : 2023-01-07 14:16:25
  • Updated at : 2024-09-13 11:07:59
  • Link: https://cs7eric.github.io/2023/01/07/netstat--ano--findstr-xxx/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
netstat -ano | findstr xxx