Windows 端口占用 Port 端口占用 如何发现端口占用并且强杀?

应用场景

场景

有时候本地测试,经常发现端口占用。

如何找到端口占用,并且 kill 掉呢?

端口占用情况

  1. lsof -i:XXX查看

  2. sudo netstat -apn | grep XXX查看

  3. ps -aux | grep XXX详细信息

  4. ps -ef | grep XXX根据分类条件查询信息

发现并强杀

复制代码
>netstat -ano | findstr "8226"
  TCP    0.0.0.0:8226           0.0.0.0:0              LISTENING       17064

>tasklist|findstr "17064"
winrdlv3.exe                 17064 Services                   0     34,664 K

【使用管理员启动命令行】

复制代码
>taskkill /f /t /im "winrdlv3.exe"

3306 端口占用

复制代码
netstat -ano | findstr "3306"
相关推荐
2601_963771379 小时前
Hardening Enterprise WordPress Sites Against REST API Leaks and Bad Headers
前端·windows·word·php
不要小看我们之间的羁绊啊11 小时前
【windows】cc + cc switch + headroom
windows
找死的豆腐13 小时前
基于.NET的Windows窗体编程之WinForms图像控件
windows·.net
XUHUOJUN13 小时前
Azure Local GPU 部署与企业应用场景指南(上篇 )
windows·microsoft·架构·nvidia·azure local
AOwhisky16 小时前
Python 基础语法(上篇 + 下篇)——综合自测题
linux·windows·python
埃博拉酱16 小时前
Pip/Conda 混用导致的 CRT 版本冲突问题:[WinError 1114] 动态链接库(DLL)初始化例程失败
windows·python
CoderYanger17 小时前
视频切割脚本(Python版)
linux·开发语言·windows·后端·python·程序人生·职场和发展
西游音月17 小时前
Windows环境下的WSL+Claude Code安装配置
windows·大模型·ai编程·wsl·claude code
小职boy1 天前
不忘初心Windows系统工具箱下载 - 系统优化与维护工具(v1.1)
windows·系统·电脑软件·工具箱
Mininglamp_27181 天前
Claude Code 封禁中国开发者之后:本地 AI 编程工具的替代方案实测
开发语言·人工智能·windows·开源软件·ai-native