centos如何杀死进程

centos杀死进程命令

分两步走,先查看进程,然后根据pid杀死进程


比如 先查看 httpd 进程 

ps aux |grep httpd 

[root@moyea309 init.d]# ps aux |grep httpd
root      2091  0.0  0.1   5488  2832 ?        Ss   17:19   0:00 /web/apache//bin/httpd -k restart
daemon    2475  0.0  0.1 283220  2256 ?        Sl   17:45   0:00 /web/apache//bin/httpd -k restart
daemon    2476  0.0  0.1 283220  2260 ?        Sl   17:45   0:00 /web/apache//bin/httpd -k restart
daemon    2477  0.0  0.1 283220  2260 ?        Sl   17:45   0:00 /web/apache//bin/httpd -k restart
root      2738  0.0  0.0   5500   736 pts/0    S+   17:56   0:00 grep httpd

这个就是 apache 的所有进程 

我们可以用  kill -9 加进程ID   如下
[root@moyea309 init.d]# kill -9 2091
[root@moyea309 init.d]# kill -9 2475
[root@moyea309 init.d]# kill -9 2476
[root@moyea309 init.d]# kill -9 2477
[root@moyea309 init.d]# ps aux |grep httpd
root      2740  0.0  0.0   5500   732 pts/0    S+   17:58   0:00 grep httpd

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值