There are many instances when we have to find and kill a unix process.
Following is the command used to kill a process forcefully:
kill -9 <process-id>
But we are not always aware of the process Id all the time . We can follow either of following two steps to find the processId :
1)
pidof can be used to find the process id for process you know the description of
Usage :
pidof /root/endeca/PlatformServices/11.0.0/j2sdk/bin/java
where /root/endeca/PlatformServices/11.0.0/j2sdk/bin/java exists in description of the pid
2) Use ps command to list all the processes and find out the one we need to delete. The process id is the highlighted number below . the result is returned on execution of ps command :
<USER> 15888 2130 2 17:31 pts/0 00:00:03 <ENDECA-HOME>/PlatformServices/11.0.0/bin/forge -vw --javaClasspath <ENDECA-HOME>/CAS/latest/lib/recordstore-forge-adapter/recordstore-forge-adapter-11.0.0.jar:./config/lib/java/spring-2.5.6.jar:./config/lib/java/eacToolkit-11.0.0.17592292.jar:./config/lib/java/spring-delegate-adapter-1.0.1.jar:./config/script:. --javaArgument -DENDECA_PROJECT_NAME=<APP-NAME> --javaArgument -Djava.util.logging.config.file=./config/script/logging.properties --logDir <ENDECA-HOME>/apps/<APP-NAME>/./logs/forges/Forge --outputPrefix <APP-NAME> --inputDir <ENDECA-HOME>/apps/<APP-NAME>/data/processing --outputDir <ENDECA-HOME>/apps/<APP-NAME>/data/forge_output --stateDir <ENDECA-HOME>/apps/<APP-NAME>/data/state --numPartitions 1 --tmpDir <ENDECA-HOME>/apps/<APP-NAME>/data/temp -o <ENDECA-HOME>/apps/<APP-NAME>/logs/forges/Forge/Forge.log <ENDECA-HOME>/apps/<APP-NAME>/data/processing/pipeline.epx
Here 15888 is the process ID.
Once we have process Id we can kill it using kill command :
Usage:
kill -9 15888
Following is the command used to kill a process forcefully:
kill -9 <process-id>
But we are not always aware of the process Id all the time . We can follow either of following two steps to find the processId :
1)
pidof can be used to find the process id for process you know the description of
Usage :
pidof /root/endeca/PlatformServices/11.0.0/j2sdk/bin/java
where /root/endeca/PlatformServices/11.0.0/j2sdk/bin/java exists in description of the pid
2) Use ps command to list all the processes and find out the one we need to delete. The process id is the highlighted number below . the result is returned on execution of ps command :
<USER> 15888 2130 2 17:31 pts/0 00:00:03 <ENDECA-HOME>/PlatformServices/11.0.0/bin/forge -vw --javaClasspath <ENDECA-HOME>/CAS/latest/lib/recordstore-forge-adapter/recordstore-forge-adapter-11.0.0.jar:./config/lib/java/spring-2.5.6.jar:./config/lib/java/eacToolkit-11.0.0.17592292.jar:./config/lib/java/spring-delegate-adapter-1.0.1.jar:./config/script:. --javaArgument -DENDECA_PROJECT_NAME=<APP-NAME> --javaArgument -Djava.util.logging.config.file=./config/script/logging.properties --logDir <ENDECA-HOME>/apps/<APP-NAME>/./logs/forges/Forge --outputPrefix <APP-NAME> --inputDir <ENDECA-HOME>/apps/<APP-NAME>/data/processing --outputDir <ENDECA-HOME>/apps/<APP-NAME>/data/forge_output --stateDir <ENDECA-HOME>/apps/<APP-NAME>/data/state --numPartitions 1 --tmpDir <ENDECA-HOME>/apps/<APP-NAME>/data/temp -o <ENDECA-HOME>/apps/<APP-NAME>/logs/forges/Forge/Forge.log <ENDECA-HOME>/apps/<APP-NAME>/data/processing/pipeline.epx
Here 15888 is the process ID.
Once we have process Id we can kill it using kill command :
Usage:
kill -9 15888