linux:
1.根据端口号查询进程
netstat -tunlp|grep port
2.根据进程查询来源程序
ps aux | grep pid
上图看出所属进程为2281
上图看出占用8083端口的程序为ngnix
windows:
比如查8099的端口
查看进程名,路径,pid 再配合使用find或findstr就可以查到pid对应的路径了
wmic process get name,executablepath,processid|findstr pid
netstat -ano|findstr 8099
wmic process get name,executablepath,processid|findstr 3344