Bash script to check running process [duplicate]

There are a few really simple methods:

pgrep procname && echo Running 
pgrep procname || echo Not running 
killall -q -0 procname && echo Running 
pidof procname && echo Running

Leave a Comment