Windows 下查看网络连接
文章目录
实例
- 根据进程ID(PID)查看某进程的所有 TCP 连接
# cmd
# 6540 为 PID
netstat -ano | findstr TCP.*6540$

- 根据 PID 查看某进程的所有 TCP 连接,并按创建时间排序
# powershell
Get-NetTCPConnection -OwningProcess 6540 |
Sort-Object CreationTime |
Format-Table Local*, Remote*, State, CreationTime

# 用 Where-Object 过滤掉临时端口(Bound)
Get-NetTCPConnection -OwningProcess 6540 |
Where-Object {$_.State -ne 'Bound'} |
Sort-Object CreationTime |
Format-Table Local*, Remote*, State, CreationTime

本文出自 qbit snap
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论