linux 進程和端口互查

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 端口號方法

相關文章
相關標籤/搜索