| 用途 | 根据端口反查占用进程 |
|---|---|
| 语法 | netstat -ano | findstr :端口;tasklist /FI "PID eq <PID>" |
| PowerShell | Get-NetTCPConnection -LocalPort 8080 | Select-Object OwningProcess 后接 Get-Process |
常用示例
常用示例
netstat -ano | findstr :8080
tasklist /FI "PID eq 4321"
netstat -ano | findstr :8080 | findstr LISTENINGPowerShell 一行流:Get-NetTCPConnection -LocalPort 8080 | ForEach-Object { Get-Process -Id $_.OwningProcess }。