Linux 按进程名杀死进程

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/suo082407128/article/details/84638683

ps -ef | grep  tomcat | grep -v grep | cut -c 9-15  | xargs kill -s 9

ps -ef 获取进程列表

grep tomcat 抓取进程中名称含有tomcat的进程

grep -v grep 排除grep进程自身

cut -c 9-15 截取9-15字符

xargs kill -s 9 把管道传递过来的作为参数执行命令

猜你喜欢

转载自blog.csdn.net/suo082407128/article/details/84638683