centOS7殺死進程命令

  

  查看當前全部正在運行的進程,能夠看到80端口被httpd佔用了(80端口但願分配給nginx使用,而不是httpd)html

netstat -tpnul

 

  這裏以殺死httpd進程爲例:nginx

  先查看 httpd 進程 apache

flaskApi) [root@67 flaskDemo]# ps aux |grep httpd 
root      6732  0.0  0.0 230488  5252 ?        Ss   8月06   2:27 /usr/sbin/httpd -DFOREGROUND apache 22570  0.0  0.0 232572  3888 ?        S    9月15   0:00 /usr/sbin/httpd -DFOREGROUND apache 22571  0.0  0.0 232572  3888 ?        S    9月15   0:00 /usr/sbin/httpd -DFOREGROUND apache 22572  0.0  0.0 232572  3904 ?        S    9月15   0:00 /usr/sbin/httpd -DFOREGROUND apache 22573  0.0  0.0 232572  3904 ?        S    9月15   0:00 /usr/sbin/httpd -DFOREGROUND apache 22574  0.0  0.0 232572  3900 ?        S    9月15   0:00 /usr/sbin/httpd -DFOREGROUND apache 27544  0.0  0.0 232572  3896 ?        S    15:41   0:00 /usr/sbin/httpd -DFOREGROUND apache 27546  0.0  0.0 232572  3900 ?        S    15:41   0:00 /usr/sbin/httpd -DFOREGROUND apache 27548  0.0  0.0 232572  3172 ?        S    15:41   0:00 /usr/sbin/httpd -DFOREGROUND apache 27550  0.0  0.0 232572  3172 ?        S    15:41   0:00 /usr/sbin/httpd -DFOREGROUND apache 27552  0.0  0.0 232572  3172 ?        S    15:41   0:00 /usr/sbin/httpd -DFOREGROUND root 27665  0.0  0.0 112728   988 pts/0    S+   15:43   0:00 grep --color=auto httpd

  這個就是 apache 的全部進程 flask

  咱們能夠用  kill -9 加進程ID   以下centos

kill -9 6732 kill -9 22570 kill -9 22571 kill -9 22572 kill -9 22573 kill -9 22574 kill -9 27544 kill -9 27546 kill -9 27548 kill -9 27550 kill -9 27552 kill -9 27665

再次查看一下httpd正在運行的進程:post

(flaskApi) [root@67 flaskDemo]# ps aux |grep httpd
root     27835  0.0  0.0 112724   988 pts/0    S+   15:46   0:00 grep --color=auto httpd

  所有殺完了... 殺死進程方法有不少種...我這個 只是其中的一種lua

 

  經過netstat確認一下,httpd已經再也不佔用80端口了url

(flaskApi) [root@67 flaskDemo]# netstat -tpnul

 

另若是不想殺死進程,而想修改端口號,centos7

操做方法參照:centos7 ngxin啓動失敗:Job for nginx.service failed(80端口被佔用的解決辦法)spa

 

 

參照文檔:

centos殺死進程命令

相關文章
相關標籤/搜索