linux script to kill java process

后端 未结 5 1008
情歌与酒
情歌与酒 2021-01-30 01:04

I want linux script to kill java program running on console.

Following is the process running as jar.

[rapp@s1-dlap0 ~]$ ps -ef |grep java
rapp    9473           


        
5条回答
  •  迷失自我
    2021-01-30 01:39

    if there are multiple java processes and you wish to kill them with one command try the below command

    kill -9 $(ps -ef | pgrep -f "java")
    

    replace "java" with any process string identifier , to kill anything else.

提交回复
热议问题