首页 > 系统服务 > 详细

linux 查看占用端口并kill掉

时间:2016-01-27 12:28:23      阅读:199      评论:0      收藏:0      [点我收藏+]

主要可以使用ps  命令 或 netstat 命令

weihong@data1:~/jd_parser/jd_parser$ ps aux | head
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  26936  1452 ?        Ss    1月18   0:41 /sbin/init
root         2  0.0  0.0      0     0 ?        S     1月18   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S     1月18   0:01 [ksoftirqd/0]

weihong@data1:~/jd_parser/jd_parser$ netstat -tlnp | head
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:9098            0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:55531         0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      -
weihong@data1:~/jd_parser/jd_parser$ netstat -tlnp | grep 8088 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 0.0.0.0:8088 0.0.0.0:* LISTEN 28617/python tcp6 0 0 :::8088 :::* LISTEN 28617/python
weihong@data1:
~/jd_parser/jd_parser$ kill -9 28617

 

linux 查看占用端口并kill掉

原文:http://www.cnblogs.com/jkmiao/p/5162470.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!