I am looking for a command that will find PIDs such as:
ps -ef | grep com.sds.afi.rte.cosmos-1.0.0.jar
cosmos 4690 4689 3 14:27 pts/8 00:00:06 java -Dlog4j.debug -Dlog4j.configuration=file:/data/cosmos/sim/bin/log4j.xml -jar com.sds.afi.rte.cosmos-1.0.0.jar
cosmos 5484 5482 0 14:30 pts/11 00:00:00 grep com.sds.afi.rte.cosmos-1.0.0.jar
and then kill these processes using:
kill -9 pid
How can I make a shell script that will do all the above automatically ?