Here’s an easy way to get the pid of a running process.

Running the “pidof” command will return the pid(s) for a running program. See sample below,

[email protected]:~> pidof syslog-ng<br /> 2043<br /> [email protected]:~> pidof acpid<br /> 2045<br /> [email protected]:~> pidof /usr/bin/firefox<br /> 14408<br /> [email protected]:~> pidof /usr/bin/compiz<br /> 27164<br /> [email protected]:~> pidof /bin/bash<br /> 27011 17339 16792 16477 15151 14403

Simple right!?