How to check if a pid is alive?

How to check if a pid is alive?

Hi,

I have a process which is running in background and I want a simple command to find if the process id still running?

How to check if a pid is alive?

Thanks

View Answers

July 18, 2015 at 2:13 AM

HI,

You can use the following command:

ps -ef | grep <pid> | grep -v grep

For example process id if the process is: 3447 then you can use the following command

ps -ef | grep 3447 | grep -v grep

and will give output something like this:

[[email protected] ~]# ps -ef | grep 3447 | grep -v grep
avahi     3447     1  0 13:17 ?        00:00:00 avahi-daemon: running [localhost.local]
avahi     3448  3447  0 13:17 ?        00:00:00 avahi-daemon: chroot helper
[[email protected] ~]#

Hope this solves your problem.

Thanks

Ads









Related Tutorials/Questions & Answers:
How to check if a pid is alive?
ModuleNotFoundError: No module named 'pid'
Advertisements
how to insert check box
how to check gremlin version
How to check spark version
How to check spark version
ModuleNotFoundError: No module named 'docker-pid'
ModuleNotFoundError: No module named 'docker-pid'
ModuleNotFoundError: No module named 'mix-pid'
ModuleNotFoundError: No module named 'pid-childs'
ModuleNotFoundError: No module named 'pid_controller'
ModuleNotFoundError: No module named 'pid-killall'
ModuleNotFoundError: No module named 'PID-pendulum'
ModuleNotFoundError: No module named 'pid-trap'
ModuleNotFoundError: No module named 'python-pid'
ModuleNotFoundError: No module named 'python-pid'
ModuleNotFoundError: No module named 'simple-pid'
ModuleNotFoundError: No module named 'pid-elapsed'
How to check keras version in anaconda
how to check a remote applications validity
How to check Hadoop version in Ubuntu?
ModuleNotFoundError: No module named 'mac-app-pid'
ModuleNotFoundError: No module named 'pymodaq-pid-models'
how to check the size of a tar file in linux
check
How to check text in textbox using JavaScript
How to check if an arraylist contains a value in Java
How to check CentOS version via command line?
how to check and print the no of times an integer is repeated in an array
How to check if a string contains a substring in iOS?
MySQL server PID file could not be found! [FAILED]

Ads