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:

[root@localhost ~]# 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
[root@localhost ~]#

Hope this solves your problem.

Thanks









Related Tutorials/Questions & Answers:
How to check if a pid is alive?
ModuleNotFoundError: No module named 'pid'
Advertisements
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-elapsed'
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 'docker-pid'
how to insert check box
how to check gremlin version
How to check a checkbox - Struts
How to check spark version
How to check spark version
ModuleNotFoundError: No module named 'mac-app-pid'
ModuleNotFoundError: No module named 'pymodaq-pid-models'
How to check no records - JSP-Servlet
how to check a remote applications validity
How to check keras version in anaconda
How to check Hadoop version in Ubuntu?
How to check whether database exists?
MySQL server PID file could not be found! [FAILED]
check
How to check a file exists or not in java.
How to check a file is hidden or not in java
how to check the size of a tar file in linux
Starting MySQL....The server quit without updating PID file
Starting MySQL.. ERROR! The server quit without updating PID file
How to check text in textbox using JavaScript
How to check CentOS version via command line?
How to check if an arraylist contains a value in Java
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?
How to check if a file is read-only in java
How to check long buffer is direct or not in java.
Starting MySQL.The server quit without updating PID file
How to Check Automorphic Number using Java Program
how to remove spell check in flex when button is clicked
How to Check Markup in PHP File from Command Line
How to put text file numbers to array and check the position of numbers?
how to check particular value is avilable in hashmap - Java Beginners
How to check if ZooKeeper is running or up from command prompt
how to check username & password from database using jsp
how to check dates while retrieving data from database
How to enter elemets in a hashmap and check for the existence of a particular key?

Ads