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
You can simply use pkill -f like this:
pkill -f
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'