Quote:
Originally Posted by haseit
3. How to search a process is exist or not using the given process name or PID using greap as above example.
|
ps aux | grep <PID>
Note: this will print the process details if it is existing along with the command we used which is grep.
like the following:
[lokesh@computer ~]$ ps aux | grep 2338
lokesh 2338 0.1 0.3 4840 1524 pts/0 Ss 11:00 0:00 bash
lokesh 2371 0.0 0.1 4044 668 pts/0 R+ 11:01 0:00 grep 2338
if the process with id 2338 is not existing the the result will be like this.
[lokesh@computer ~]$ ps aux | grep 2338
lokesh 2371 0.0 0.1 4044 668 pts/0 R+ 11:01 0:00 grep 2338
Don't get confused.