killall杀掉用户所有进程

本来想模拟宕机,但是服务器不在本地,怕起不来,改用杀用户所有进程来模拟。
找到了killall来操作,看下效果:

[dangpg@localhost2 ~]$ ps xuf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
dangpg    1944  0.0  0.0 108344  1820 pts/1    S    17:10   0:00 -bash
dangpg    2500  0.0  0.0 110220  1044 pts/1    R+   17:13   0:00  \_ ps xuf
dangpg   24685  0.0  0.1 2294596 68032 ?       S    Jul25   0:16 /home/dangpg/app/pg96/bin/postgres -D /home/dangpg/data/pg96
dangpg   24686  0.0  0.0 118724  1352 ?        Ss   Jul25   0:00  \_ postgres: logger process                                   
dangpg   24689  0.0  0.1 2296776 99252 ?       Ss   Jul25   0:41  \_ postgres: checkpointer process                             
dangpg   24690  0.0  0.0 2294696 23016 ?       Ss   Jul25   0:11  \_ postgres: writer process                                   
dangpg   24691  0.0  0.0 2294596 17936 ?       Ss   Jul25   0:23  \_ postgres: wal writer process                               
dangpg   24692  0.0  0.0 2295024 2348 ?        Ss   Jul25   0:19  \_ postgres: autovacuum launcher process                      
dangpg   24693  0.0  0.0 123080  2828 ?        Ss   Jul25   2:31  \_ postgres: stats collector process                          
dangpg    2797  0.0  0.0 264256 12032 ?        S    May24   1:31 /home/dangpg/app/pg10/bin/postgres -D /home/dangpg/data/pg10
dangpg    2798  0.0  0.0 117116   868 ?        Ss   May24   0:00  \_ postgres: logger process                                   
dangpg    2802  0.0  0.2 264568 132312 ?       Ss   May24   0:04  \_ postgres: checkpointer process                             
dangpg    2803  0.0  0.2 264256 133616 ?       Ss   May24   1:04  \_ postgres: writer process                                   
dangpg    2804  0.0  0.0 264256  5272 ?        Ss   May24   1:07  \_ postgres: wal writer process                               
dangpg    2805  0.0  0.0 264696  1820 ?        Ss   May24   1:47  \_ postgres: autovacuum launcher process                      
dangpg    2806  0.0  0.0 119344  1036 ?        Ss   May24   3:42  \_ postgres: stats collector process                          
dangpg    2807  0.0  0.0 264548  1456 ?        Ss   May24   0:04  \_ postgres: bgworker: logical replication launcher           
[dangpg@localhost2 ~]$ killall -u dangpg
[dangpg@localhost2 ~]$ ps xuf
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
dangpg    1944  0.0  0.0 108344  1824 pts/1    S    17:10   0:00 -bash
dangpg    2505  0.0  0.0 110220  1040 pts/1    R+   17:13   0:00  \_ ps xuf
[dangpg@localhost2 ~]$ 

转载于:https://my.oschina.net/yafeishi/blog/1925210

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值