How to check the process is already running or not

Posted by TechGuru on Ask Ubuntu See other posts from Ask Ubuntu or by TechGuru
Published on 2014-05-29T11:21:12Z Indexed on 2014/05/29 21:59 UTC
Read the original article Hit count: 362

Filed under:
|
|
|

I want to check the particular process in already running or not.

I refereed this Q&A.

But I didn't get any specific solution. Following is the example that I tried: I have created abc.sh file and run this script on background, like sh abc.sh &.

Now this file is running on background and I fire the ps aux | grep "abc" command.

Following is the output of this command:

prakash     3594  0.0  0.0   4388   820 pts/0    S+   16:44   0:00 grep --color=auto abc

After that I stop the abc.sh running script and fire the same command ps aux | grep "abc" command.

But I am getting same output like:

prakash     3594  0.0  0.0   4388   820 pts/0    S+   16:44   0:00 grep --color=auto abc

Is there any other way to find the process is running or not?

© Ask Ubuntu or respective owner

Related posts about command-line

Related posts about bash