Given a pid, for example 29264, how to get to know whether the process is running ?
Is there any easy way to do that ?
thx
Given a pid, for example 29264, how to get to know whether the process is running ?
Is there any easy way to do that ?
thx
Process status (ps
) provides the information you're looking for:
ps -p 29264
Output in case the process is running (quick example on my Mac, works the same on Linux):
PID TIME CMD
127 4:54.03 /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
Otherwhise:
PID TIME CMD
kill -0 29264
,and inspect the error (if any)