查看进程
shell
wmic process get ProcessId,ParentProcessId,Name查看端口
windows
bash
# 查看所有活动连接和监听端口
netstat -ano
# 查看特定端口(例如8080)
netstat -ano | findstr 8080
# 查看占用端口的进程
netstat -ano | findstr 8080
tasklist | findstr <PID号码>linux
bash
# 查看所有监听端口
netstat -tulpn
# 查看特定端口(例如8080)
netstat -tulpn | grep 8080
# 只列出监听的端口
netstat -lntp