Grep java process running in linux environment
Last week, my colleague ask for my assistance to found out is a java process still running in a linux machine.
Firstly, I used the ps -ef command to list all active process. But there is too many process running. Thus I narrow down my search by specifying ps -ef |grep -i java. But, still there is multiple process found.
I can't be sure that is the specific java process is still alive or end becasue the ps command don't give enough info which java process is running. So I can only tell my colleague that few java process is running but I am not sure is the specific java process still running.
After that incident, I have tried to search in google and some other site. But also didn't found any solution/way to find out whether a specific java process is running. So I decide to post this question/problem here. Hopefully, may be you can provide a solution to me. Or may be later, I will found a solution later. And share it with you.
Firstly, I used the ps -ef command to list all active process. But there is too many process running. Thus I narrow down my search by specifying ps -ef |grep -i java. But, still there is multiple process found.
I can't be sure that is the specific java process is still alive or end becasue the ps command don't give enough info which java process is running. So I can only tell my colleague that few java process is running but I am not sure is the specific java process still running.
After that incident, I have tried to search in google and some other site. But also didn't found any solution/way to find out whether a specific java process is running. So I decide to post this question/problem here. Hopefully, may be you can provide a solution to me. Or may be later, I will found a solution later. And share it with you.
3 Comments:
very easy only let say u run your java program using "java HellowWorld", then just use command "ps -ef|grep java HelloWorld"
pls call me genius.
By Thiam Teck (1983 - ?), at 7:47 PM
I tried your way, but is not working lah.....
By Chin Tat, at 9:20 AM
Tried that on Ubuntu 11.10... It works.
I need to kill Netbeans IDE instanse, so i typed:
~$ ps -ef | grep netbeans
And it shows me all processes with name netbeans, have to say there were a lot of text but tis is better then nothing)
By andrewdevnotes, at 3:18 PM
Post a Comment
<< Home