linux script to kill java process

后端 未结 5 1012
情歌与酒
情歌与酒 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:33

    You can simply use pkill -f like this:

    pkill -f 'java -jar'
    

    EDIT: To kill a particular java process running your specific jar use this regex based pkill command:

    pkill -f 'java.*lnwskInterface'
    

提交回复
热议问题