查看服务器上用户名下的进程并删减

1. 查看: htop -u longfei-fwxz

2.删减:

    ps -A -ostat,ppid,pid,cmd | grep -e'^[Zz]' |awk '{print $2}' | xargs kill -9

    ps -A -ostat,ppid,pid,cmd | grep -E "mappo" | grep -v grep | awk '$2==1 {print $3}' | xargs kill -9

    ps -A -ostat,ppid,pid,cmd | grep -E "mappo" | grep -v grep | awk '{print $3}' | xargs kill -9

    #ps -A -ostat,ppid,pid,cmd | grep -E "sshd: shiyu" | grep -v grep | awk '$2==1 {print $3}' | xargs kill -9

    ps -A -ostat,ppid,pid,cmd | grep -E "Xvfb -br -nolisten" | grep -v grep | awk '$2==1 {print $3}' | xargs kill -9

    #ps -A -ostat,ppid,pid,cmd | grep -E "rmappo-MPE-tes" | grep -v grep | awk '$2==1 {print $3}' | xargs kill -9

 3.删除某个具体pid

    kill -9 pid

posted @ 2021-11-19 15:34  呦呦南山  阅读(89)  评论(0编辑  收藏  举报