1.根据进程名查看端口:spa
a.先获取进程号即pidcode
ps -ef|grep Name
b.用netstat获取端口号blog
netstat -nap|grep pid
2.根据端口号查询进程名:进程
有两种方法:class
a: lsof -i:端口号grep
b. netstat -tunlp|grep 端口号方法