Linux:
1、#顯示tcp,udp的端口和進程等相關情況
netstat -tunlp
2、#查看指定端口號的進程情況
netstat -tunlp | grep 端口號
3、#查看所有有關tomcat的進程詳細信息
ps aux | grep tomcat
4、#根據進程id(PID)查看該進程詳細信息
ps aux | grep pid
Windows:
1、開始---->運行---->cmd,或者是window+R組合鍵,調出命令窗口
2、列出所有端口號情況
netstat -ano
3、根據已知端口號查看對應的PID
netstat -aon|findstr 3306
4、根據PID查看是哪個進程和程序佔用此端口號
tasklist|findstr 6012