One Liner Command to Check If Linux Process is Running

I would like to share one liner command to check if a Linux process is running. Below is the one liner command and you can replace “sendmail” to any process you want to check: –

chkdaemon="sendmail" ; ! pgrep $chkdaemon >/dev/null && echo "$chkdaemon not running" || echo "$chkdaemon is running"

I will be sharing more useful commands. Thank you and have fun.