0
点赞
收藏
分享

微信扫一扫

将启动命令中包含某个字符串的进行杀死

weednoah 2023-04-12 阅读 89


[root@dn01 testbash]# ps -ef | grep hello
root     24794  7457  0 11:09 pts/2    00:00:00 sh hello.sh
root     24910  7457  0 11:09 pts/2    00:00:00 sh hello.sh
root     25295  7457  0 11:11 pts/2    00:00:00 grep hello

使用

ps aux | grep hello | grep -v grep |awk '{print $2}'| xargs kill -9

可以将上述的前两个进程杀死


举报

相关推荐

0 条评论