7

查看端口进程(linux and windows平台)

 3 years ago
source link: http://www.hechunbo.com/index.php/archives/385.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

查看端口及进程

netstat -tunlp | grep 端口号
lsof -i:端口号
ps -ef|grep 进程号

netstat -aon|findstr "8558"  -- windows
  TCP    0.0.0.0:8558           0.0.0.0:0              LISTENING       54820
  TCP    [::]:8558              [::]:0                 LISTENING       54820
tasklist|findstr "54820" -- 查看指定 PID 的进程
    java.exe                     54820 Console                    1    201,600 K
taskkill /T /F /PID 9088  -- 结束进程
    
  • t (tcp) 仅显示tcp相关选项
  • -u (udp)仅显示udp相关选项
  • -n 拒绝显示别名,能显示数字的全部转化为数字
  • -l 仅列出在Listen(监听)的服务状态
  • -p 显示建立相关链接的程序名
creativecommons-cc.png
本文由 hcb 创作,采用 知识共享署名 3.0,可自由转载、引用,但需署名作者且注明文章出处。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK