PowerShell / CMD
PowerShell / CMD
netstat -ano | Select-String ':8080'
netstat -ano | findstr LISTENING | findstr ':80 '
# PID → 进程:
tasklist /FI "PID eq 12345"
Get-Process -Id 12345 | Select-Object ProcessName, Path
Get-NetTCPConnection -LocalPort 8080 | Select-Object LocalAddress, State, OwningProcess| 场景 | Windows 端口冲突 / 可疑监听排查 |
|---|---|
| 工具 | netstat -ano、Get-NetTCPConnection、tasklist |
| 要点 | PID 在输出行最右侧;监听状态显示为 LISTENING |
Windows 的 netstat 字段与 Linux 不同:Local Address 0.0.0.0:80 表示所有网卡,127.0.0.1:80 仅本机。