数据库生态圈(RDB & NoSQL & Bigdata)——专注于关系库优化(Oracle & Mysql & Postgresql & SQL Server )

https://www.cnblogs.com/lhdz_bj
http://blog.itpub.net/8484829
https://blog.csdn.net/tuning_optmization
https://www.zhihu.com/people/lhdz_bj

导航

linux下批量kill进程的方法

--kill某个用户下的所有进程(用户为test)
--pkill
  # pkill -u test
--killall
  # killall -u test
--ps
  # ps -ef | grep test | awk '{ print $2 }' | xargs kill -9
--pgrep

  # pgrep -u test | xargs kill -9

 

--kill某个程序的所有进程(程序为postgresql)

--ps

  # ps -ef|grep postgres|grep -v grep|awk '{print $2}'|sudo xargs kill -9

  或

  # kill -9 ps -ef|grep postgres|grep -v grep|awk '{print $2}'

 

posted on 2018-04-17 17:24  lhdz_bj  阅读(351)  评论(0编辑  收藏  举报