Linux 查看端口占用并杀掉

1. 查看端口号占用情况:

[plain] view plaincopy
 
  1. netstat -apn|grep 80  

 

tcp        0      0 10.65.42.27:80              172.22.142.20:62771         ESTABLISHED6426/lighttpd


2. 确定进程号

为上面标红显示

 

找到进程号以后,再使用以下命令查看详细信息:

[plain] view plaincopy
 
  1. ps -aux|grep <进程号>  
eg: ps -aux | grep 6426

bae       6426  0.0  0.2 133724 22848 ?      Sl   Feb27   0:22 bin/lighttpd

 

3. 杀掉该进程

[plain] view plaincopy
 
    1. kill -9
posted @ 2015-09-17 20:52  missAnnie  阅读(301)  评论(0编辑  收藏  举报